add the db_patches and model_version tables to the database.
authorpietrus <pietrus>
Tue, 13 Sep 2005 21:44:50 +0000 (21:44 +0000)
committerpietrus <pietrus>
Tue, 13 Sep 2005 21:44:50 +0000 (21:44 +0000)
dbscripts/populate_dbpatches.sql [new file with mode: 0755]
dbscripts/populate_modelversion.sql [new file with mode: 0755]
dbscripts/updates/update20050913.sql [new file with mode: 0755]

diff --git a/dbscripts/populate_dbpatches.sql b/dbscripts/populate_dbpatches.sql
new file mode 100755 (executable)
index 0000000..0e46e6f
--- /dev/null
@@ -0,0 +1,11 @@
+
+INSERT INTO "db_patches" VALUES (1, DATE '2002-12-13', "* introduces sequences and primary keys for comment_status, article_type and
+language\n * adds is_html to comment");
+INSERT INTO "db_patches" VALUES (2, DATE '2003-04-09', "* creates table comment_x_media, to support media in comments\n * adds webdb_lastchange to comment");
+INSERT INTO "db_patches" VALUES (3, DATE '2003-11-22', "* added a bunch of fields to webdb_user: is_disabled, email, profile, creation date, last login date");
+INSERT INTO "db_patches" VALUES (4, DATE '2003-11-24', "* Clean up comments\n * added a comment field for internal comments");
+INSERT INTO "db_patches" VALUES (5, DATE '2003-11-25', "* Removal of media (uploaded_media and content are now independently)\n * Clean up of content\n * Added a field for content-locking\n * Added a keywords field for content");
+INSERT INTO "db_patches" VALUES (6, DATE '2003-12-12', "* makes login unique on webdb_users\n * drops unnecessary index on webdb_users\n * inserts a line for ogg support in media_types\n * drop "- deprecated -" from media_types\n * drop redundant index on id of topic\n * drop redundant index on id of comment\n * recreate indexes on content_x_media");
+INSERT INTO "db_patches" VALUES (7, DATE '2005-01-09', "* adds filter and filtergroups to the database");
+INSERT INTO "db_patches" VALUES (8, DATE '2005-09-13', "* adds 'db_patches' and 'model_version' tables to the database");
+
diff --git a/dbscripts/populate_modelversion.sql b/dbscripts/populate_modelversion.sql
new file mode 100755 (executable)
index 0000000..d44a945
--- /dev/null
@@ -0,0 +1,3 @@
+
+INSERT INTO "model_version" VALUES ("1.1-1");
+
diff --git a/dbscripts/updates/update20050913.sql b/dbscripts/updates/update20050913.sql
new file mode 100755 (executable)
index 0000000..0e6b95d
--- /dev/null
@@ -0,0 +1,44 @@
+-- update script 2005-09-08 by pietro
+--
+-- * adds "db_patches" and "model_version" tables to the database
+--
+-- This script will terminate with an error the second time it's run,
+--   so running this script when it isn't needed can't do any harm.
+--
+
+BEGIN TRANSACTION;
+
+--
+-- db_patches
+--
+
+CREATE SEQUENCE "db_patches_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
+
+CREATE TABLE "db_patches" (
+  "id" integer DEFAULT nextval('filter_group_id_seq'::text) NOT NULL,
+  "date" date NOT NULL,
+  "description" text
+);
+
+INSERT INTO "db_patches" VALUES (1, DATE '2002-12-13', "* introduces sequences and primary keys for comment_status, article_type and
+      language\n * adds is_html to comment");
+INSERT INTO "db_patches" VALUES (2, DATE '2003-04-09', "* creates table comment_x_media, to support media in comments\n * adds webdb_lastchange to comment");
+INSERT INTO "db_patches" VALUES (3, DATE '2003-11-22', "* added a bunch of fields to webdb_user: is_disabled, email, profile, creation date, last login date");
+INSERT INTO "db_patches" VALUES (4, DATE '2003-11-24', "* Clean up comments\n * added a comment field for internal comments");
+INSERT INTO "db_patches" VALUES (5, DATE '2003-11-25', "* Removal of media (uploaded_media and content are now independently)\n * Clean up of content\n * Added a field for content-locking\n * Added a keywords field for content");
+INSERT INTO "db_patches" VALUES (6, DATE '2003-12-12', "* makes login unique on webdb_users\n * drops unnecessary index on webdb_users\n * inserts a line for ogg support in media_types\n * drop "- deprecated -" from media_types\n * drop redundant index on id of topic\n * drop redundant index on id of comment\n * recreate indexes on content_x_media");
+INSERT INTO "db_patches" VALUES (7, DATE '2005-01-09', "* adds filter and filtergroups to the database");
+INSERT INTO "db_patches" VALUES (8, DATE '2005-09-13', "* adds 'db_patches' and 'model_version' tables to the database for database changes tracking");
+
+--
+-- model_version
+--
+
+CREATE TABLE "model_version" (
+  "description"  character varying(24)
+);
+
+INSERT INTO "model_version" VALUES ("1.1-1");
+
+COMMIT TRANSACTION;
+