debug and coninue clean
This commit is contained in:
parent
02bb4fae16
commit
fc24f202ef
@ -1,53 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 9975c56b36b8
|
||||
Revises:
|
||||
Create Date: 2025-03-13 18:49:11.155773
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '9975c56b36b8'
|
||||
down_revision: Union[str, None] = None
|
||||
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('user',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('email', sa.String(), nullable=False),
|
||||
sa.Column('login', sa.String(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('blog',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('owner_id', sa.INTEGER(), nullable=False),
|
||||
sa.Column('name', sa.String(), nullable=False),
|
||||
sa.Column('description', sa.String(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['owner_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('post',
|
||||
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
|
||||
sa.Column('header', sa.String(), nullable=False),
|
||||
sa.Column('text', sa.String(), nullable=False),
|
||||
sa.Column('author_id', sa.INTEGER(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['author_id'], ['user.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('post')
|
||||
op.drop_table('blog')
|
||||
op.drop_table('user')
|
||||
# ### end Alembic commands ###
|
@ -1,32 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 7182f3a2d8f1
|
||||
Revises: 9975c56b36b8
|
||||
Create Date: 2025-03-13 22:02:24.302197
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = '7182f3a2d8f1'
|
||||
down_revision: Union[str, None] = '9975c56b36b8'
|
||||
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.add_column('post', sa.Column('blog_id', sa.INTEGER(), nullable=False))
|
||||
op.create_foreign_key(None, 'post', 'blog', ['blog_id'], ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(None, 'post', type_='foreignkey')
|
||||
op.drop_column('post', 'blog_id')
|
||||
# ### end Alembic commands ###
|
@ -21,7 +21,7 @@ if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
|
||||
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
|
||||
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
|
||||
create_user_and_database $db
|
||||
# import_dump $db
|
||||
import_dump $db
|
||||
done
|
||||
echo "Multiple databases created"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user