@@ -0,0 +1,2029 @@
+%22%22%22Add new tables that associate calendars and exception dates to a meta vj%0A%0ARevision ID: 3b17c15627cb%0ARevises: 43822e80c45a%0ACreate Date: 2015-01-20 17:08:23.570348%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '3b17c15627cb'%0Adown_revision = '43822e80c45a'%0A%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Aimport geoalchemy2 as ga%0Afrom sqlalchemy.dialects import postgresql%0A%0Adef upgrade():%0A    op.create_table('associated_calendar',%0A    sa.Column('id', sa.BIGINT(), nullable=False),%0A    sa.Column('calendar_id', sa.BIGINT(), nullable=False),%0A    sa.Column('name', sa.TEXT(), nullable=False),%0A    sa.ForeignKeyConstraint(%5B'calendar_id'%5D, %5Bu'navitia.calendar.id'%5D, name=u'associated_calendar_calendar_fkey'),%0A    sa.PrimaryKeyConstraint('id'),%0A    schema='navitia'%0A    )%0A    op.create_table('associated_exception_date',%0A    sa.Column('id', sa.BIGINT(), nullable=False),%0A    sa.Column('datetime', sa.DATE(), nullable=False),%0A    sa.Column('type_ex', postgresql.ENUM(u'Add', u'Sub', name='associated_exception_type'), nullable=False),%0A    sa.Column('associated_calendar_id', sa.BIGINT(), nullable=False),%0A    sa.ForeignKeyConstraint(%5B'associated_calendar_id'%5D, %5Bu'navitia.associated_calendar.id'%5D, name=u'associated_exception_date_associated_calendar_fkey'),%0A    sa.PrimaryKeyConstraint('id'),%0A    schema='navitia'%0A    )%0A    op.create_table('rel_metavj_associated_calendar',%0A    sa.Column('meta_vj_id', sa.BIGINT(), nullable=True),%0A    sa.Column('associated_calendar_id', sa.BIGINT(), nullable=True),%0A    sa.ForeignKeyConstraint(%5B'meta_vj_id'%5D, %5Bu'navitia.meta_vj.id'%5D, name=u'rel_metavj_associated_calendar_meta_vj_fkey'),%0A    sa.ForeignKeyConstraint(%5B'associated_calendar_id'%5D, %5Bu'navitia.associated_calendar.id'%5D, name=u'rel_metavj_associated_calendar_associated_calendar_fkey'),%0A    schema='navitia'%0A    )%0A%0Adef downgrade():%0A    op.drop_table('rel_metavj_associated_calendar', schema='navitia')%0A    op.drop_table('associated_exception_date', schema='navitia')%0A    op.drop_table('associated_calendar', schema='navitia')%0A

move calendar association in DB