added events
This commit is contained in:
parent
d59e74919f
commit
5fdf84f432
2 changed files with 53 additions and 0 deletions
37
migrations/versions/0ddf19141ead_.py
Normal file
37
migrations/versions/0ddf19141ead_.py
Normal file
|
@ -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 ###
|
16
models.py
16
models.py
|
@ -32,3 +32,19 @@ class MatrixRoom(db.Model):
|
|||
|
||||
def __repr__(self):
|
||||
return '<MatrixRoom %r>' % 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
|
||||
|
|
Loading…
Reference in a new issue