aboutsummaryrefslogtreecommitdiff
path: root/migrations/2016_07_18_144155_create_messages_table.py
blob: 369bbc68bc370e4153418c7b16270bdb254b9565 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from orator.migrations import Migration


class CreateMessagesTable(Migration):

    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create('messages') as table:
            table.increments('id')
            table.string('filename')
            table.string('folder').references('name').on('folders')
            table.string('subject', 1023).nullable()
            table.datetime('date').nullable()
            table.string('content_type')

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