from orator.migrations import Migration class CreateVersesTable(Migration): def up(self): """ Run the migrations. """ with self.schema.create('verses') as table: table.string('book') table.small_integer('chapter') table.small_integer('nr') table.foreign('book').references('canonical_name').on('books') table.primary(['book', 'chapter', 'nr']) def down(self): """ Revert the migrations. """ self.schema.drop('verses')