Skip to content

Commit

Permalink
DESENG-632 Add DB tables & API routes (#2533)
Browse files Browse the repository at this point in the history
* DESENG-632 Add DB tables & API routes

* DESENG-623 fix linting

* DESENG-623 Move language to migration file, remove delete crud language route

* DESENG-623 Remove ability to delete language

---------

Co-authored-by: Alex <[email protected]>
  • Loading branch information
Baelx and Alex authored Jun 4, 2024
1 parent 0959d82 commit 8f09e10
Show file tree
Hide file tree
Showing 12 changed files with 965 additions and 144 deletions.
12 changes: 11 additions & 1 deletion met-api/migrations/README
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
Generic single-database configuration.
# Migrations

Uses alembic, SQL Alchemy, and flask-migrate to perform DB migrations.

To create a new revision:

`alembic revision -m "description of revision"`

## Languages

The list of languages in `versions/c656f3f82334_add_languages_and_tenant_mapping.py` has been taken from [https://www.w3schools.com/tags/ref_language_codes.asp](https://www.w3schools.com/tags/ref_language_codes.asp) and modified slightly to remove duplicate or multiple language codes per language.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
Relax language table constraints.
Revision ID: 22fb6b5b5aed
Revises: ae232e299180
Create Date: 2024-05-27 15:56:23.549731
"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = '22fb6b5b5aed'
down_revision = 'ae232e299180'
branch_labels = None
depends_on = None

def upgrade():
op.alter_column('language', 'right_to_left', nullable = True)
op.alter_column('language', 'code', type_ = sa.String(length=20))

def downgrade():
op.alter_column('language', 'right_to_left', nullable = False)
op.alter_column('language', 'code', type_ = sa.String(length=2))



Loading

0 comments on commit 8f09e10

Please sign in to comment.