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')