diff --git a/migrations/versions/0ddf19141ead_.py b/migrations/versions/0ddf19141ead_.py new file mode 100644 index 0000000..a14492e --- /dev/null +++ b/migrations/versions/0ddf19141ead_.py @@ -0,0 +1,37 @@ +"""empty message + +Revision ID: 0ddf19141ead +Revises: d2033352cfdf +Create Date: 2017-03-04 13:42:49.178781 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '0ddf19141ead' +down_revision = 'd2033352cfdf' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('matrix_msg_events', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('event_id', sa.Text(), nullable=True), + sa.Column('room_id', sa.Text(), nullable=True), + sa.Column('pnut_msgid', sa.Text(), nullable=True), + sa.Column('pnut_user', sa.Text(), nullable=True), + sa.Column('pnut_chan', sa.Text(), nullable=True), + sa.Column('deleted', sa.Boolean(), nullable=True), + sa.PrimaryKeyConstraint('id') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('matrix_msg_events') + # ### end Alembic commands ### diff --git a/models.py b/models.py index ba0c49c..18b8ce8 100644 --- a/models.py +++ b/models.py @@ -32,3 +32,19 @@ class MatrixRoom(db.Model): def __repr__(self): return '' % self.room_id + +class MatrixMsgEvents(db.Model): + id = db.Column(db.Integer, primary_key=True) + event_id = db.Column(db.Text) + room_id = db.Column(db.Text) + pnut_msgid = db.Column(db.Text) + pnut_user = db.Column(db.Text) + pnut_chan = db.Column(db.Text) + deleted = db.Column(db.Boolean, default=False) + + def __init__(self, event_id, room_id, pnut_msgid, pnut_user, pnut_chan): + self.event_id = event_id + self.room_id = room_id + self.pnut_msgid = pnut_msgid + self.pnut_user = pnut_user + self.pnut_chan = pnut_chan