Commit graph

10 commits

Author SHA1 Message Date
Kevin Morris
b5ff8581f3
feat(migrations): add upgrade_voteinfo_integers ref
This migration modifies the Yes, No, Abstain and ActiveTUs columns
of the TUVoteInfo table from unsigned TINYINT to unsigned INTEGER.

TINYINT supports a total of 1 byte (up to 255 trusted users). This
is quite limited and we don't spend too much more by storing a
standard 4-byte INTEGER.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-06 20:27:23 -08:00
Kevin Morris
25937d9543 Merge branch 'master' into pu 2021-06-06 17:21:57 -07:00
Kevin Morris
f9f41dc99b restore TU_VoteInfo -> utf8mb4_general_ci
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-06 16:30:16 -07:00
Kevin Morris
5ceeb88bee remove unused imports, rectify isort violations
Files got into the branch that violate both PEP-8 guidelines
and isorts. This fixes them.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-05 21:27:39 -07:00
Kevin Morris
bac38edd48 [db] fix schema and migration for case insensitivity
Some of the columns that were changed still want to be
case insensitive. Good thing our tables have nice
separation.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-05 15:08:18 -07:00
Leonidas Spyropoulos
b1121dc6ca Adds Alembic migration for DB/Tables conversion to utf8mb4
MySql defaults to `utf8` and case insensitive collation so migrate these to case sensitive and `utf8mb4`

Closes #21

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
2021-05-18 05:42:36 -07:00
Leonidas Spyropoulos
0d68b914bf Conditionally apply SSOAccountId migration to support misaligned databases
Closes: #34

Signed-off-by: Leonidas Spyropoulos <artafinde@gmail.com>
2021-05-18 05:42:36 -07:00
Kevin Morris
82f6d2ce75 alembic: fix ef39fcd6e1cd downgrade
op.drop_constraint requires a valid field to drop the constraint on.
Without this, downgrade cannot occur.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-05-18 05:42:36 -07:00
Frédéric Mangano-Tarumi
a5554c19a9 Add SSO account ID in table Users
This column holds a user ID issed by the single sign-on provider. For
Keycloak, it is an UUID. For more flexibility, we will be using a
standardly-sized VARCHAR field.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2021-02-20 11:24:30 -05:00
Frédéric Mangano-Tarumi
e4cbe264cf Create an initial Alembic migration
This way the database will get stamped, and Git will create the
`versions` directory without which Alembic won’t work.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2020-02-27 16:44:36 +01:00