summaryrefslogtreecommitdiff
path: root/taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2013-08-16 12:17:20 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2013-08-24 22:46:43 -0700
commitdc56ff482a9d5e6b8e3ac979b10c29ee5662df2f (patch)
tree1db9e7a04aa397bf9d59e9e95bbb1fa44bb35b30 /taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako
parent38a9908be4d78924d7a2b0a119403e564c6bdf8f (diff)
downloadtaskflow-dc56ff482a9d5e6b8e3ac979b10c29ee5662df2f.tar.gz
Rework the persistence layer
1. Simplify the exposed api to reduce race conditions which could occur if we allowed flow details, task details and log books to be deleted at different times; reduce this down to just being able to save and delete from logbooks (and only save/update for flow and task details to) to reduce the problem cases. 2. Introduce a alembic migration with a proper schema so that the initial database can be created in the first place, adjust its exposed fields and relations to be defined by said schema. 3. Use oslo db models instead of our own. Change-Id: I78bbedf87d506d3f39157198638937c933235b7b
Diffstat (limited to 'taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako')
-rw-r--r--taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako22
1 files changed, 22 insertions, 0 deletions
diff --git a/taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako b/taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako
new file mode 100644
index 0000000..9570201
--- /dev/null
+++ b/taskflow/persistence/backends/sqlalchemy/alembic/script.py.mako
@@ -0,0 +1,22 @@
+"""${message}
+
+Revision ID: ${up_revision}
+Revises: ${down_revision}
+Create Date: ${create_date}
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = ${repr(up_revision)}
+down_revision = ${repr(down_revision)}
+
+from alembic import op
+import sqlalchemy as sa
+${imports if imports else ""}
+
+def upgrade():
+ ${upgrades if upgrades else "pass"}
+
+
+def downgrade():
+ ${downgrades if downgrades else "pass"}