[Et-mgmt-commits-list] [SCM] virt-factory branch, master now at v0.0.3-6-g0a73cb9
Scott Seago
sseago at redhat.com
Tue Jul 3 16:10:35 UTC 2007
Hello,
This is an automated email from the git hooks/update script, it was
generated because a ref change was pushed to the repository.
Updating branch, master,
via 0a73cb9799a24982c173e97b274b03b91f84e1e0 (commit)
from 864cae13b5dbc52079beecf1e440213fb1158b8f (commit)
- Log -----------------------------------------------------------------
commit 0a73cb9799a24982c173e97b274b03b91f84e1e0
Author: Scott Seago <sseago at redhat.com>
Date: Tue Jul 3 12:10:31 2007 -0400
make downgrade work.
-----------------------------------------------------------------------
Diffstat:
service/db/schema/upgrade/0002.py | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/service/db/schema/upgrade/0002.py b/service/db/schema/upgrade/0002.py
index ff4cca2..4d50bf0 100644
--- a/service/db/schema/upgrade/0002.py
+++ b/service/db/schema/upgrade/0002.py
@@ -11,19 +11,27 @@ tables = [] # no new tables
table = dict([(t.name, t) for t in tables])
-def column_additions():
+def get_columns():
machines_table = sqlalchemy.Table('machines',meta)
state_column = Column('state',String(255),nullable=True)
- create_column(state_column,table=machines_table)
deployments_table = sqlalchemy.Table('deployments',meta)
auto_start_column = Column('auto_start',Integer,nullable=True)
- create_column(auto_start_column,table=deployments_table)
+ return { state_column: machines_table,
+ auto_start_column: deployments_table }
+
+columns = get_columns()
+
+def column_additions():
+
+ for c, t in columns.items():
+ create_column(c, table=t)
def column_removals():
- # FIXME
- pass
+ for c, t in columns.items():
+ drop_column(c, table=t)
+
def initial_inserts():
# no inserts for this step
@@ -36,6 +44,7 @@ def upgrade():
column_additions()
def downgrade():
+ column_removals()
mylist = list(tables)
mylist.reverse()
for t in mylist:
hooks/update
---
Git Source Code Management System
hooks/update refs/heads/master \
864cae13b5dbc52079beecf1e440213fb1158b8f \
0a73cb9799a24982c173e97b274b03b91f84e1e0
More information about the Et-mgmt-commits-list
mailing list