Commit graph

60 commits

Author SHA1 Message Date
TLSM
4d22d9bce2
Eager load get_posts for submission_listings.
Ported in logic from upstream to use SQLAlchemy eager loading instead
of repeated queries when building a submission_listing. Adjusted
loaded relationships to include only those used on TheMotte.

Using test data from seed_db, before and after:

GET /
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   83   |   0    |   0    |   0    |   83   |     72     |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 83 in 0.031s

GET /
|----------|--------|--------|--------|--------|--------|------------|
| Database | SELECT | INSERT | UPDATE | DELETE | Totals | Duplicates |
|----------|--------|--------|--------|--------|--------|------------|
| default  |   14   |   0    |   0    |   0    |   14   |     0      |
|----------|--------|--------|--------|--------|--------|------------|
Total queries: 14 in 0.00718s
2022-11-28 12:55:31 -05:00
TLSM
3f360bb457 Remove special cases for unused awards.
Removes the following awards / fields on User:
 - flairlock
 - progressivestack
 - bird
 - longpost (pizzashill)
 - marseyawarded
 - rehab
 - deflector
 - mute
 - unmutable
 - eye (All-Seeing Eye)
 - alt (Alt-Seeing Eye)

Primarily motivated by starting to remove some un-Mottelike cruft
from core commenting/posting routes. Cleared out other inapplicable
awards while in the process.
2022-11-09 20:37:04 -06:00
TLSM
a35697e55e
Replace nearly all ?v= cachebusts with assetcache.
Using the new assetcache module, we replace (almost) all instances
of `?v=` cachebusting query parameters in Python and in Jinja templates.
The primary exceptions were: user site backgrounds, and some
infrequently changed graphics referenced literally from .js files.
2022-08-30 17:02:46 -04:00
FatherInire
fcba426009
Remove some gimmicky r/drama features.
Co-authored-by: Inire <>
2022-05-21 21:43:00 -05:00
faul-sname
4892b58d10
Add migrations using alembic.
* #39 Add Flask-Migrate dep

* #39 Make it such that flask db init can run

https://github.com/miguelgrinberg/Flask-Migrate/issues/196#issuecomment-381343393

* Run flask db init, update migrations.env, commit artifacts

* Set up a script such that you can `docker-compose exec files bash -c 'cd /service; FLASK_APP="files/cli:app" flask '` and have it do whatever flask thing you want

* Fix circular dependency

* import * is evil

* Initial alembic migration, has issues with constraints and nullable columns

* Bring alts table up to date with alembic autogenerate

* Rerun flask db revision autogenerate

* Bring award_relationships table up to date with alembic autogenerate

* [#39/alembic] files/classes/__init__.py is evil but is at least explicitly evil now

* #39 fix model in files/classes/badges.py

* #39 fix model in files/classes/domains.py and files/classes/clients.py

* #39 fix models: comment saves, comment flags

* #39 fix models: comments

* Few more imports

* #39 columns that are not nullable should be flagged as not nullable

* #39 Add missing indexes to model defs

* [#39] add missing unique constraints to model defs

* [#39] Temporarily undo any model changes which cause the sqlalchemy model to be out of sync with the actual dump

* #39 Deforeignkeyify the correct column to make alembic happy

* #39 flask db revision --autogenerate now creates an empty migration

* #39 Migration format such that files are listed in creation order

* #39 Better first revision

* #39 Revert the model changes that were required to get to zero differences between db revision --autogenerate and the existing schema

* #39 The first real migration

* #39 Ensure that foreign key constraints are named in migration

* #39 Alembic migrations for FK constraints, column defs

* [#39] Run DB migrations before starting tests

* [#39] New test to ensure migrations are up to date

* [#39] More descriptive test failure message

* Add -T flag to docker-compose exec

* [#39] Run alembic migrations when starting the container
2022-05-17 18:55:17 -05:00
Ben Rog-Wilhelm
1ee9c1bfa7
Convert text file line endings to LF. 2022-05-09 07:20:47 -05:00
Aevann1
5d6e14b9b3 fsd 2022-04-02 19:11:35 +02:00
Aevann1
d5f294db77 gdfg 2022-03-31 18:28:53 +02:00
Aevann1
fde6526a56 fds' 2022-02-23 07:17:03 +02:00
Aevann1
3b126e72f8
Many to many (#210)
* 8 legs of love

* 8 legs of love 2
2022-02-14 14:25:44 -08:00
Aevann1
e410bc879c big big chungus big chungus big chungus 2022-02-13 03:08:12 +02:00
Aevann1
82e044ea93 xvc 2022-02-13 01:10:29 +02:00
Aevann1
778abb00c3 sfd 2022-02-04 12:19:49 +02:00
Aevann1
d2cfe31886 fsd 2022-02-03 11:16:09 +02:00
Aevann1
43cdc4976f fds 2022-02-03 08:42:47 +02:00
Aevann1
a172970b4b biggest money 2022-01-31 03:41:04 +02:00
Aevann1
cc03c7b09d gfd 2022-01-30 22:43:04 +02:00
Aevann1
3f3131ebad fsd 2022-01-28 23:42:09 +02:00
Aevann1
60015915b8 f 2022-01-25 01:49:02 +02:00
Aevann1
cb4386b9b8 cvvc 2022-01-24 18:49:23 +02:00
Aevann1
b529d36183 vcx 2022-01-24 18:46:07 +02:00
Aevann1
50029701f9 cvcv 2022-01-24 18:44:54 +02:00
Aevann1
1295121f54 fgg 2022-01-24 18:17:21 +02:00
Aevann1
025713e25b
Update badges.py 2022-01-23 13:59:08 -08:00
Aevann1
9585efa68d fdsfsd 2022-01-23 21:51:56 +02:00
Aevann1
bbea5577a9 fs 2022-01-22 21:28:49 +02:00
Aevann1
dbdcefcfd9 cxzzcx 2022-01-22 21:21:16 +02:00
Aevann1
34ce4a8f0d gfdfg 2022-01-22 14:27:28 +02:00
Aevann1
7e9622a118 devrama 2022-01-22 12:41:37 +02:00
Aevann1
2072c944cd gfdg 2022-01-22 00:27:10 +02:00
Aevann1
3d3aad7414 vxc 2022-01-21 16:42:13 +02:00
Aevann1
60976ba54f czxczx 2022-01-21 16:40:01 +02:00
Aevann1
694dfca0a4 fds 2022-01-19 11:07:16 +02:00
Aevann1
3e46b16f3e 1k 2022-01-17 17:03:51 +02:00
Aevann1
c076e7abac bb 2022-01-13 03:28:02 +02:00
Aevann1
b60a0cf628 fds 2022-01-07 01:07:24 +02:00
Aevann1
148e6b1dd4 fa 2022-01-07 00:18:38 +02:00
Aevann1
67b5d4e121 sdf 2021-12-25 01:00:09 +02:00
Aevann1
309c01508b dfssfd 2021-12-11 02:53:16 +02:00
Aevann1
8b36d95215 sdffd 2021-11-26 00:09:18 +02:00
Aevann1
de2e848d94 fsd 2021-11-21 20:54:36 +02:00
Aevann1
b06a4de85c badges 2021-11-21 19:40:47 +02:00
Aevann1
1a13a0d833 \ 2021-11-11 20:58:09 +02:00
Aevann1
234401f351 fds 2021-11-02 13:33:36 -07:00
Aevann1
b88b8ddcc4 sdffsd 2021-10-18 20:09:02 +02:00
Aevann1
29346b0248 fgd 2021-10-18 17:58:06 +02:00
Aevann1
aad9218a83 fdsf 2021-10-15 21:53:36 +02:00
Aevann1
2265d60b22 fd 2021-10-15 16:08:27 +02:00
Aevann1
1e8b636da0 fgdg 2021-10-07 00:38:15 +02:00
Aevann1
66b302a86d fsdfs 2021-09-22 16:51:36 +02:00