Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit a9fceaf

Browse files
authored
Merge pull request #2 from benoitblanc/manage_user_permalinks
Create user_bookmarks table
2 parents 20fbcb3 + 0d1f380 commit a9fceaf

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"""create user bookmarks table
2+
3+
Revision ID: 0352a94313d6
4+
Revises: c77774920e5b
5+
Create Date: 2021-04-15 14:58:38.844986
6+
7+
"""
8+
from alembic import op
9+
import sqlalchemy as sa
10+
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '0352a94313d6'
14+
down_revision = 'c77774920e5b'
15+
branch_labels = None
16+
depends_on = None
17+
18+
19+
def upgrade():
20+
sql = sa.sql.text("""
21+
CREATE TABLE qwc_config.user_bookmarks (
22+
username character varying NOT NULL,
23+
data text,
24+
key varchar(10),
25+
date date,
26+
description text,
27+
PRIMARY KEY(username, key)
28+
);
29+
""")
30+
31+
conn = op.get_bind()
32+
conn.execute(sql)
33+
34+
35+
def downgrade():
36+
sql = sa.sql.text("""
37+
DROP TABLE qwc_config.user_bookmarks;
38+
""")
39+
40+
conn = op.get_bind()
41+
conn.execute(sql)

0 commit comments

Comments
 (0)