-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add endpoint and quick fix on size.
- Loading branch information
1 parent
6ef77cf
commit 8d074c6
Showing
7 changed files
with
192 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"""Update size for 'demain' again. | ||
Revision ID: 1932d4fa450b | ||
Revises: 3d2e4be5a52b | ||
Create Date: 2023-10-31 01:10:05.699656 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "1932d4fa450b" | ||
down_revision = "3d2e4be5a52b" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"formation", | ||
"domain", | ||
existing_type=mysql.VARCHAR(length=255), | ||
type_=sa.Text(), | ||
existing_nullable=False, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"formation", | ||
"domain", | ||
existing_type=sa.Text(), | ||
type_=mysql.VARCHAR(length=255), | ||
existing_nullable=False, | ||
) | ||
# ### end Alembic commands ### |
104 changes: 104 additions & 0 deletions
104
migrations/versions/3d2e4be5a52b_alter_formation_table_update_size.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
"""Alter table formation upate size. | ||
Revision ID: 3d2e4be5a52b | ||
Revises: ee56a7eaab4a | ||
Create Date: 2023-10-31 00:49:13.312551 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import mysql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "3d2e4be5a52b" | ||
down_revision = "ee56a7eaab4a" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column( | ||
"formation", | ||
"type", | ||
existing_type=mysql.VARCHAR(length=120), | ||
type_=sa.String(length=255), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"libelle", | ||
existing_type=mysql.VARCHAR(length=120), | ||
type_=sa.String(length=255), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"tutelle", | ||
existing_type=mysql.VARCHAR(length=120), | ||
type_=sa.String(length=255), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"niveau_de_sortie", | ||
existing_type=mysql.VARCHAR(length=120), | ||
type_=sa.String(length=255), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"duree", | ||
existing_type=mysql.VARCHAR(length=15), | ||
type_=sa.String(length=255), | ||
existing_nullable=False, | ||
) | ||
op.drop_constraint("favori_formation_id_fk", "user_favori", type_="foreignkey") | ||
op.create_foreign_key( | ||
None, "user_favori", "formation", ["formation_id"], ["id"], ondelete="CASCADE" | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_constraint(None, "user_favori", type_="foreignkey") | ||
op.create_foreign_key( | ||
"favori_formation_id_fk", "user_favori", "formation", ["formation_id"], ["id"] | ||
) | ||
op.alter_column( | ||
"formation", | ||
"duree", | ||
existing_type=sa.String(length=255), | ||
type_=mysql.VARCHAR(length=15), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"niveau_de_sortie", | ||
existing_type=sa.String(length=255), | ||
type_=mysql.VARCHAR(length=120), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"tutelle", | ||
existing_type=sa.String(length=255), | ||
type_=mysql.VARCHAR(length=120), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"libelle", | ||
existing_type=sa.String(length=255), | ||
type_=mysql.VARCHAR(length=120), | ||
existing_nullable=False, | ||
) | ||
op.alter_column( | ||
"formation", | ||
"type", | ||
existing_type=sa.String(length=255), | ||
type_=mysql.VARCHAR(length=120), | ||
existing_nullable=False, | ||
) | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters