rename migration files to be sorted alphabetically
This commit is contained in:
parent
8e752689df
commit
03e7fb0bb2
5 changed files with 96 additions and 0 deletions
|
@ -9,6 +9,7 @@ script_location = alembic
|
|||
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
|
||||
# for all available tokens
|
||||
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
|
||||
file_template = %%(epoch)s_%%(slug)s
|
||||
|
||||
# sys.path path, will be prepended to sys.path if present.
|
||||
# defaults to the current working directory.
|
||||
|
|
54
alembic/versions/1710945368_add_names_pronouns_fields.py
Normal file
54
alembic/versions/1710945368_add_names_pronouns_fields.py
Normal file
|
@ -0,0 +1,54 @@
|
|||
"""Add names/pronouns/fields
|
||||
|
||||
Revision ID: 1d8f8443a7f5
|
||||
Revises: 0b63f7c8ab96
|
||||
Create Date: 2024-03-20 15:36:08.756635
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "1d8f8443a7f5"
|
||||
down_revision: Union[str, None] = "0b63f7c8ab96"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"users",
|
||||
sa.Column(
|
||||
"names",
|
||||
postgresql.JSONB(astext_type=sa.Text()),
|
||||
nullable=False,
|
||||
server_default="[]",
|
||||
),
|
||||
)
|
||||
op.add_column(
|
||||
"users",
|
||||
sa.Column(
|
||||
"pronouns",
|
||||
postgresql.JSONB(astext_type=sa.Text()),
|
||||
nullable=False,
|
||||
server_default="[]",
|
||||
),
|
||||
)
|
||||
op.add_column(
|
||||
"users",
|
||||
sa.Column(
|
||||
"fields",
|
||||
postgresql.JSONB(astext_type=sa.Text()),
|
||||
nullable=False,
|
||||
server_default="[]",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_column("users", "fields")
|
||||
op.drop_column("users", "pronouns")
|
||||
op.drop_column("users", "names")
|
41
alembic/versions/1710946859_add_members.py
Normal file
41
alembic/versions/1710946859_add_members.py
Normal file
|
@ -0,0 +1,41 @@
|
|||
"""Add members
|
||||
|
||||
Revision ID: 17cc8cb77be5
|
||||
Revises: 1d8f8443a7f5
|
||||
Create Date: 2024-03-20 16:00:59.251354
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '17cc8cb77be5'
|
||||
down_revision: Union[str, None] = '1d8f8443a7f5'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('members',
|
||||
sa.Column('id', sa.BigInteger(), nullable=False),
|
||||
sa.Column('name', sa.Text(), nullable=False),
|
||||
sa.Column('display_name', sa.Text(), nullable=True),
|
||||
sa.Column('bio', sa.Text(), nullable=True),
|
||||
sa.Column('names', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
|
||||
sa.Column('pronouns', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
|
||||
sa.Column('fields', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
|
||||
sa.Column('user_id', sa.BigInteger(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('members')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in a new issue