Browse Source

Ajout de la dernière migration

master
Louis Chauvet 1 month ago
parent
commit
56b12b2a02
Signed by: Louis Chauvet <louis.chauvet@free.fr> GPG Key ID: 1ECA046A9615ABA0
1 changed files with 48 additions and 0 deletions
  1. 48
    0
      migrations/versions/1699c2f4e48f_.py

+ 48
- 0
migrations/versions/1699c2f4e48f_.py View File

@@ -0,0 +1,48 @@
"""empty message

Revision ID: 1699c2f4e48f
Revises: 87b039db71a5
Create Date: 2019-09-09 19:06:48.482601

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '1699c2f4e48f'
down_revision = '87b039db71a5'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('post',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('type', sa.String(length=20), nullable=True),
sa.Column('text', sa.Text(_expect_unicode=True), nullable=True),
sa.Column('date_created', sa.DateTime(), nullable=True),
sa.Column('date_modified', sa.DateTime(), nullable=True),
sa.Column('author_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['author_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.drop_table('content')
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('content',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('type', sa.VARCHAR(length=20), autoincrement=False, nullable=True),
sa.Column('data', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('date_created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('date_modified', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('author_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['author_id'], ['user.id'], name='content_author_id_fkey'),
sa.PrimaryKeyConstraint('id', name='content_pkey')
)
op.drop_table('post')
# ### end Alembic commands ###

Loading…
Cancel
Save