Thread: [Cs-webapplibs-commits] SF.net SVN: cs-webapplibs:[135] trunk/0.3/setup/schema.mysql.sql
Status: Beta
Brought to you by:
crazedsanity
From: <cra...@us...> - 2009-08-24 15:53:21
|
Revision: 135 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=135&view=rev Author: crazedsanity Date: 2009-08-24 15:53:15 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Updated to have the proper syntax & to avoid duplication of key & table creation. Modified Paths: -------------- trunk/0.3/setup/schema.mysql.sql Modified: trunk/0.3/setup/schema.mysql.sql =================================================================== --- trunk/0.3/setup/schema.mysql.sql 2009-08-24 15:34:54 UTC (rev 134) +++ trunk/0.3/setup/schema.mysql.sql 2009-08-24 15:53:15 UTC (rev 135) @@ -111,28 +111,12 @@ -- -------------------------------------------------------- --- --- Table structure for table `cswal_log_table` --- -CREATE TABLE `cswal_log_table` ( - `log_id` int(11) NOT NULL auto_increment, - `creation` timestamp NOT NULL default CURRENT_TIMESTAMP, - `event_id` int(11) NOT NULL, - `uid` int(11) NOT NULL, - `affected_uid` int(11) NOT NULL, - `details` text NOT NULL, - PRIMARY KEY (`log_id`), - KEY `cswal_log_table_event_id_fkey` (`event_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - -- -- Constraints for table `cswal_log_attribute_table` -- ALTER TABLE `cswal_log_attribute_table` - ADD CONSTRAINT `cswal_log_attribute_table_attribute_id_fkey` FOREIGN KEY (`attribute_id`) REFERENCES `cswal_attribute_table` (`attribute_id`), ADD CONSTRAINT `cswal_log_attribute_table_log_id_fkey` FOREIGN KEY (`log_id`) REFERENCES `cswal_log_table` (`log_id`); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-08-24 15:56:01
|
Revision: 136 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=136&view=rev Author: crazedsanity Date: 2009-08-24 15:55:55 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Updated schema via an SQL dump (via PHPMyAdmin) after successfully loading schema. Modified Paths: -------------- trunk/0.3/setup/schema.mysql.sql Modified: trunk/0.3/setup/schema.mysql.sql =================================================================== --- trunk/0.3/setup/schema.mysql.sql 2009-08-24 15:53:15 UTC (rev 135) +++ trunk/0.3/setup/schema.mysql.sql 2009-08-24 15:55:55 UTC (rev 136) @@ -12,7 +12,7 @@ -- version 2.10.3 -- http://www.phpmyadmin.net -- --- Generation Time: Aug 10, 2009 at 11:01 AM +-- Generation Time: Aug 24, 2009 at 10:55 AM -- Server version: 5.0.22 -- PHP Version: 5.1.6 @@ -22,6 +22,26 @@ -- -------------------------------------------------------- -- +-- Table structure for table `cswal_auth_token_table` +-- + +CREATE TABLE `cswal_auth_token_table` ( + `auth_token_id` bigint(20) unsigned NOT NULL auto_increment, + `uid` int(11) NOT NULL default '0', + `checksum` text NOT NULL, + `token` text NOT NULL, + `max_uses` int(11) default NULL, + `total_uses` int(11) NOT NULL default '0', + `creation` timestamp NOT NULL default CURRENT_TIMESTAMP, + `last_updated` timestamp NOT NULL default '0000-00-00 00:00:00', + `expiration` timestamp NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (`auth_token_id`), + UNIQUE KEY `auth_token_id` (`auth_token_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- -- Table structure for table `cswal_category_table` -- @@ -29,7 +49,7 @@ `category_id` int(11) NOT NULL auto_increment, `category_name` text NOT NULL, PRIMARY KEY (`category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -41,7 +61,7 @@ `class_id` int(11) NOT NULL auto_increment, `class_name` text NOT NULL, PRIMARY KEY (`class_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- @@ -57,11 +77,27 @@ PRIMARY KEY (`event_id`), KEY `cswal_event_table_class_id_fkey` (`class_id`), KEY `cswal_event_table_category_id_fkey` (`category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- +-- Table structure for table `cswal_log_attribute_table` +-- + +CREATE TABLE `cswal_log_attribute_table` ( + `log_attribute_id` int(11) NOT NULL auto_increment, + `log_id` int(11) NOT NULL, + `attribute_id` int(11) NOT NULL, + `value_text` text NOT NULL, + PRIMARY KEY (`log_attribute_id`), + KEY `cswal_log_attribute_table_log_id_fkey` (`log_id`), + KEY `cswal_log_attribute_table_attribute_id_fkey` (`attribute_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + +-- -- Table structure for table `cswal_log_table` -- @@ -74,89 +110,57 @@ `details` text NOT NULL, PRIMARY KEY (`log_id`), KEY `cswal_log_table_event_id_fkey` (`event_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- -------------------------------------------------------- + -- --- Constraints for dumped tables +-- Table structure for table `cswal_session_store_table` -- +CREATE TABLE `cswal_session_store_table` ( + `session_store_id` int(11) NOT NULL auto_increment, + `session_id` varchar(32) NOT NULL, + `user_id` varchar(16) NOT NULL, + `date_created` datetime NOT NULL, + `last_updated` datetime NOT NULL, + `session_data` longtext NOT NULL, + PRIMARY KEY (`session_store_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- -------------------------------------------------------- + -- --- Constraints for table `cswal_event_table` +-- Table structure for table `cswal_version_table` -- -ALTER TABLE `cswal_event_table` - ADD CONSTRAINT `cswal_event_table_class_id_fkey` FOREIGN KEY (`class_id`) REFERENCES `cswal_class_table` (`class_id`), - ADD CONSTRAINT `cswal_event_table_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `cswal_category_table` (`category_id`); +CREATE TABLE `cswal_version_table` ( + `version_id` int(11) NOT NULL, + `project_name` varchar(30) NOT NULL, + `version_string` varchar(50) NOT NULL, + PRIMARY KEY (`version_id`), + UNIQUE KEY `project_name` (`project_name`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + -- --- Constraints for table `cswal_log_table` +-- Constraints for dumped tables -- -ALTER TABLE `cswal_log_table` - ADD CONSTRAINT `cswal_log_table_event_id_fkey` FOREIGN KEY (`event_id`) REFERENCES `cswal_event_table` (`event_id`); - - -- --- Table structure for table `cswal_log_attribute_table` +-- Constraints for table `cswal_event_table` -- +ALTER TABLE `cswal_event_table` + ADD CONSTRAINT `cswal_event_table_class_id_fkey` FOREIGN KEY (`class_id`) REFERENCES `cswal_class_table` (`class_id`), + ADD CONSTRAINT `cswal_event_table_category_id_fkey` FOREIGN KEY (`category_id`) REFERENCES `cswal_category_table` (`category_id`); -CREATE TABLE `cswal_log_attribute_table` ( - `log_attribute_id` int(11) NOT NULL auto_increment, - `log_id` int(11) NOT NULL, - `attribute_id` int(11) NOT NULL, - `value_text` text NOT NULL, - PRIMARY KEY (`log_attribute_id`), - KEY `cswal_log_attribute_table_log_id_fkey` (`log_id`), - KEY `cswal_log_attribute_table_attribute_id_fkey` (`attribute_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - - - -- -- Constraints for table `cswal_log_attribute_table` -- ALTER TABLE `cswal_log_attribute_table` ADD CONSTRAINT `cswal_log_attribute_table_log_id_fkey` FOREIGN KEY (`log_id`) REFERENCES `cswal_log_table` (`log_id`); - - - --- This table create statement MUST work in PostgreSQL v8.2.x+ AND MySQL v5.0.x+: --- otherwise separate schema files have to be created and the code will have to --- do extra checking... -- -CREATE TABLE cswal_version_table ( - version_id int NOT NULL PRIMARY KEY, - project_name varchar(30) NOT NULL UNIQUE, - version_string varchar(50) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - -CREATE TABLE cswal_auth_token_table ( - auth_token_id serial NOT NULL PRIMARY KEY, - uid integer NOT NULL DEFAULT 0, - checksum text NOT NULL, - token text NOT NULL, - max_uses integer DEFAULT NULL, - total_uses integer NOT NULL DEFAULT 0, - creation timestamp NOT NULL DEFAULT NOW(), - last_updated timestamp, - expiration timestamp NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; - - - --- --- Store session data in here. --- Idea originally from: http://www.developertutorials.com/tutorials/php/saving-php-session-data-database-050711 --- - -CREATE TABLE `cswal_session_store_table` ( - `session_store_id` int NOT NULL AUTO_INCREMENT, - `session_id` varchar(32) NOT NULL, - `user_id` varchar(16) NOT NULL, - `date_created` datetime NOT NULL, - `last_updated` datetime NOT NULL, - `session_data` LONGTEXT NOT NULL, - PRIMARY KEY (`session_store_id`) -) ENGINE = InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; \ No newline at end of file +-- Constraints for table `cswal_log_table` +-- +ALTER TABLE `cswal_log_table` + ADD CONSTRAINT `cswal_log_table_event_id_fkey` FOREIGN KEY (`event_id`) REFERENCES `cswal_event_table` (`event_id`); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-08-24 16:06:10
|
Revision: 137 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=137&view=rev Author: crazedsanity Date: 2009-08-24 16:05:54 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Set the cswal_version_table's pkey to auto increment. Modified Paths: -------------- trunk/0.3/setup/schema.mysql.sql Modified: trunk/0.3/setup/schema.mysql.sql =================================================================== --- trunk/0.3/setup/schema.mysql.sql 2009-08-24 15:55:55 UTC (rev 136) +++ trunk/0.3/setup/schema.mysql.sql 2009-08-24 16:05:54 UTC (rev 137) @@ -135,7 +135,7 @@ -- CREATE TABLE `cswal_version_table` ( - `version_id` int(11) NOT NULL, + `version_id` int(11) NOT NULL auto_increment, `project_name` varchar(30) NOT NULL, `version_string` varchar(50) NOT NULL, PRIMARY KEY (`version_id`), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-08-24 16:26:05
|
Revision: 138 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=138&view=rev Author: crazedsanity Date: 2009-08-24 16:25:59 +0000 (Mon, 24 Aug 2009) Log Message: ----------- Added cswal_attribute_table definition. Modified Paths: -------------- trunk/0.3/setup/schema.mysql.sql Modified: trunk/0.3/setup/schema.mysql.sql =================================================================== --- trunk/0.3/setup/schema.mysql.sql 2009-08-24 16:05:54 UTC (rev 137) +++ trunk/0.3/setup/schema.mysql.sql 2009-08-24 16:25:59 UTC (rev 138) @@ -1,18 +1,8 @@ --- --- SVN INFORMATION::: --- --------------- --- SVN Signature::::::: $Id$ --- Last Author::::::::: $Author$ --- Current Revision:::: $Revision$ --- Repository Location: $HeadURL$ --- Last Updated:::::::: $Date$ --- - -- phpMyAdmin SQL Dump -- version 2.10.3 -- http://www.phpmyadmin.net -- --- Generation Time: Aug 24, 2009 at 10:55 AM +-- Generation Time: Aug 24, 2009 at 11:31 AM -- Server version: 5.0.22 -- PHP Version: 5.1.6 @@ -22,6 +12,18 @@ -- -------------------------------------------------------- -- +-- Table structure for table `cswal_attribute_table` +-- + +CREATE TABLE `cswal_attribute_table` ( + `attribute_id` int(11) NOT NULL auto_increment, + `attribute_name` text NOT NULL, + PRIMARY KEY (`attribute_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; + +-- -------------------------------------------------------- + +-- -- Table structure for table `cswal_auth_token_table` -- @@ -37,7 +39,7 @@ `expiration` timestamp NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`auth_token_id`), UNIQUE KEY `auth_token_id` (`auth_token_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -49,7 +51,7 @@ `category_id` int(11) NOT NULL auto_increment, `category_name` text NOT NULL, PRIMARY KEY (`category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -61,7 +63,7 @@ `class_id` int(11) NOT NULL auto_increment, `class_name` text NOT NULL, PRIMARY KEY (`class_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -77,7 +79,7 @@ PRIMARY KEY (`event_id`), KEY `cswal_event_table_class_id_fkey` (`class_id`), KEY `cswal_event_table_category_id_fkey` (`category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -93,7 +95,7 @@ PRIMARY KEY (`log_attribute_id`), KEY `cswal_log_attribute_table_log_id_fkey` (`log_id`), KEY `cswal_log_attribute_table_attribute_id_fkey` (`attribute_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -110,7 +112,7 @@ `details` text NOT NULL, PRIMARY KEY (`log_id`), KEY `cswal_log_table_event_id_fkey` (`event_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -126,7 +128,7 @@ `last_updated` datetime NOT NULL, `session_data` longtext NOT NULL, PRIMARY KEY (`session_store_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -------------------------------------------------------- @@ -140,7 +142,7 @@ `version_string` varchar(50) NOT NULL, PRIMARY KEY (`version_id`), UNIQUE KEY `project_name` (`project_name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Constraints for dumped tables This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cra...@us...> - 2009-08-26 17:50:42
|
Revision: 142 http://cs-webapplibs.svn.sourceforge.net/cs-webapplibs/?rev=142&view=rev Author: crazedsanity Date: 2009-08-26 17:50:33 +0000 (Wed, 26 Aug 2009) Log Message: ----------- Updated schema with relationship comments & a required foreign key. Modified Paths: -------------- trunk/0.3/setup/schema.mysql.sql Modified: trunk/0.3/setup/schema.mysql.sql =================================================================== --- trunk/0.3/setup/schema.mysql.sql 2009-08-26 16:12:12 UTC (rev 141) +++ trunk/0.3/setup/schema.mysql.sql 2009-08-26 17:50:33 UTC (rev 142) @@ -2,7 +2,7 @@ -- version 2.10.3 -- http://www.phpmyadmin.net -- --- Generation Time: Aug 24, 2009 at 11:31 AM +-- Generation Time: Aug 26, 2009 at 12:54 PM -- Server version: 5.0.22 -- PHP Version: 5.1.6 @@ -79,8 +79,16 @@ PRIMARY KEY (`event_id`), KEY `cswal_event_table_class_id_fkey` (`class_id`), KEY `cswal_event_table_category_id_fkey` (`category_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- +-- RELATIONS FOR TABLE `cswal_event_table`: +-- `class_id` +-- `cswal_class_table` -> `class_id` +-- `category_id` +-- `cswal_category_table` -> `category_id` +-- + -- -------------------------------------------------------- -- @@ -95,8 +103,16 @@ PRIMARY KEY (`log_attribute_id`), KEY `cswal_log_attribute_table_log_id_fkey` (`log_id`), KEY `cswal_log_attribute_table_attribute_id_fkey` (`attribute_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- +-- RELATIONS FOR TABLE `cswal_log_attribute_table`: +-- `attribute_id` +-- `cswal_attribute_table` -> `attribute_id` +-- `log_id` +-- `cswal_log_table` -> `log_id` +-- + -- -------------------------------------------------------- -- @@ -112,8 +128,14 @@ `details` text NOT NULL, PRIMARY KEY (`log_id`), KEY `cswal_log_table_event_id_fkey` (`event_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +-- +-- RELATIONS FOR TABLE `cswal_log_table`: +-- `event_id` +-- `cswal_event_table` -> `event_id` +-- + -- -------------------------------------------------------- -- @@ -159,6 +181,7 @@ -- Constraints for table `cswal_log_attribute_table` -- ALTER TABLE `cswal_log_attribute_table` + ADD CONSTRAINT `cswal_log_attribute_table_attribute_id_fkey` FOREIGN KEY (`attribute_id`) REFERENCES `cswal_attribute_table` (`attribute_id`), ADD CONSTRAINT `cswal_log_attribute_table_log_id_fkey` FOREIGN KEY (`log_id`) REFERENCES `cswal_log_table` (`log_id`); -- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |