aboutsummaryrefslogtreecommitdiff
path: root/migrations/2015_10_14_17201444836036_create_alternative_book_names_table.py
blob: 7d6265519404d469412bcad26e761fc7b6d52e2a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from orator.migrations import Migration


class CreateAlternativeBookNamesTable(Migration):

    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create('alternative_book_names') as table:
            table.string('name').primary()
            table.string('book')
            table.foreign('book').references('canonical_name').on('books')

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop('alternative_book_names')