roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r425801 - in /incubator/roller/branches/roller_3.0/metadata/database: 240-to-300-migration.vm control.vm
Date Wed, 26 Jul 2006 18:34:00 GMT
Author: agilliland
Date: Wed Jul 26 11:34:00 2006
New Revision: 425801

URL: http://svn.apache.org/viewvc?rev=425801&view=rev
Log:
adding new control macro #addColumnNull()

updating 3.0 migration script with additional comments.


Modified:
    incubator/roller/branches/roller_3.0/metadata/database/240-to-300-migration.vm
    incubator/roller/branches/roller_3.0/metadata/database/control.vm

Modified: incubator/roller/branches/roller_3.0/metadata/database/240-to-300-migration.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/metadata/database/240-to-300-migration.vm?rev=425801&r1=425800&r2=425801&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/metadata/database/240-to-300-migration.vm (original)
+++ incubator/roller/branches/roller_3.0/metadata/database/240-to-300-migration.vm Wed Jul
26 11:34:00 2006
@@ -6,17 +6,26 @@
 
 -- Roller 3.0 schema changes
 
-alter table website add column pagemodels varchar(512) default null;
+-- add new column which holds the list of custom models for a weblog
+#addColumnNull("website" "pagemodels" "varchar(512)")
 
+-- add new columns which hold the multi-lang settings for a weblog
 #addColumnNotNull("website" "enablemultilang" $BOOLEAN_SQL_TYPE $BOOLEAN_FALSE)
 #addColumnNotNull("website" "showalllangs" $BOOLEAN_SQL_TYPE $BOOLEAN_TRUE)
 
-alter table weblogentry add column locale varchar(20) default null;
+-- add new column which holds the locale for a weblog entry
+-- then set the values and make column not null
+#addColumnNull("weblogentry" "locale" "varchar(20)")
 
+-- add new column which holds the hidden status for a page, default is false
 #addColumnNotNull("webpage" "hidden" $BOOLEAN_SQL_TYPE $BOOLEAN_FALSE)
 
-alter table webpage add column templatelang varchar(20) default null;
+-- add new column which holds the template language used for a page
+-- then set template language to velocity for all templates
+#addColumnNull("webpage" "templatelang" "varchar(20)")
 update webpage set templatelang = 'velocity';
 
-alter table webpage add column decorator varchar(255) default null;
-update webpage set decorator = '_decorator';
\ No newline at end of file
+-- add new column which holds the decorator for a page
+-- then set value to _decorator for all templates except decorators
+#addColumnNull("webpage" "decorator" "varchar(255)")
+update webpage set decorator = '_decorator' where name <> '_decorator';
\ No newline at end of file

Modified: incubator/roller/branches/roller_3.0/metadata/database/control.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/metadata/database/control.vm?rev=425801&r1=425800&r2=425801&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/metadata/database/control.vm (original)
+++ incubator/roller/branches/roller_3.0/metadata/database/control.vm Wed Jul 26 11:34:00
2006
@@ -7,7 +7,18 @@
 #** Define templates to be generated **#
 #set( $templates = ["createdb", "200-to-210-migration", "210-to-230-migration", "230-to-240-migration",
"240-to-300-migration"]) 
 
-#** Define special macro needed for alter table with not-null restriction **#
+
+#**
+Special macro to add table column with default null
+**#
+#macro(addColumnNull $table $column $type)
+alter table $table add column $column $type default null;
+#end
+
+
+#**
+Special macro to add table column with not-null restriction and default value
+**#
 #macro(addColumnNotNull $table $column $type $default)
 #if($DBTYPE == "MYSQL" || $DBTYPE=="HSQDB")
 alter table $table add column $column $type default $default not null;  



Mime
View raw message