Skip to content

Commit 5ccd07c

Browse files
committed
Migration to add read-only AdminFlag
1 parent afaab96 commit 5ccd07c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
"""
13+
Add read-only AdminFlag
14+
15+
Revision ID: 6418f7d86a4b
16+
Revises: 5dda74213989
17+
Create Date: 2018-03-23 20:51:31.558587
18+
"""
19+
20+
from alembic import op
21+
22+
23+
revision = '6418f7d86a4b'
24+
down_revision = 'bf73e785eed9'
25+
26+
27+
def upgrade():
28+
op.execute("""
29+
INSERT INTO warehouse_admin_flag(id, description, enabled, notify)
30+
VALUES (
31+
'read-only',
32+
'Read Only Mode: Any write operations will have no effect',
33+
FALSE,
34+
TRUE
35+
)
36+
""")
37+
38+
39+
def downgrade():
40+
op.execute("DELETE FROM warehouse_admin_flag WHERE id = 'read-only'")

0 commit comments

Comments
 (0)