diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-07-04 00:14:37 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-07-04 00:38:51 +0100 |
| commit | 19e1ed8b32179e3317c807b3ab0581e3b5fb00a2 (patch) | |
| tree | 3e3409482aa7a0f8c8da8721df26350f64a00f6a /migrations | |
| parent | eb6b1d6375841cd7b87b4f6a08b34ed5239a6354 (diff) | |
| download | cheatdb-19e1ed8b32179e3317c807b3ab0581e3b5fb00a2.tar.xz | |
Implement forum parser to increase accuracy
Diffstat (limited to 'migrations')
| -rw-r--r-- | migrations/versions/9fc23495713b_.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/migrations/versions/9fc23495713b_.py b/migrations/versions/9fc23495713b_.py new file mode 100644 index 0000000..f457ae5 --- /dev/null +++ b/migrations/versions/9fc23495713b_.py @@ -0,0 +1,55 @@ +"""empty message + +Revision ID: 9fc23495713b +Revises: de004661c5e1 +Create Date: 2018-07-04 00:03:20.123285 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '9fc23495713b' +down_revision = 'de004661c5e1' +branch_labels = None +depends_on = None +from sqlalchemy.dialects.postgresql import ENUM + +type_enum = ENUM('MOD', 'GAME', 'TXP', name='packagetype', create_type=False) + +def upgrade(): + type_enum.create(op.get_bind(), checkfirst=True) + + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('krock_forum_topic') + op.create_table('forum_topic', + sa.Column('topic_id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('author_id', sa.Integer(), nullable=False), + sa.Column('type', type_enum, nullable=True), + sa.Column('title', sa.String(length=200), nullable=False), + sa.Column('name', sa.String(length=30), nullable=True), + sa.Column('link', sa.String(length=200), nullable=True), + sa.Column('posts', sa.Integer(), nullable=False), + sa.Column('views', sa.Integer(), nullable=False), + sa.Column('created_at', sa.DateTime(), nullable=False), + sa.ForeignKeyConstraint(['author_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('topic_id') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('forum_topic') + op.create_table('krock_forum_topic', + sa.Column('topic_id', sa.Integer(), autoincrement=False, nullable=False), + sa.Column('author_id', sa.Integer(), nullable=False), + sa.Column('ttype', sa.Integer(), nullable=False), + sa.Column('title', sa.String(length=200), nullable=False), + sa.Column('name', sa.String(length=30), nullable=True), + sa.Column('link', sa.String(length=50), nullable=True), + sa.ForeignKeyConstraint(['author_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('topic_id') + ) + # ### end Alembic commands ### |
