* modified the structure of options table
[vsc.git] / _res / schema.sql
blob7a811dd7d7a1d123b264823fba1f20dff07eebbe
1 -- phpMyAdmin SQL Dump
2 -- version 2.11.4
3 -- http://www.phpmyadmin.net
4 --
5 -- Host: localhost
6 -- Generation Time: Apr 25, 2008 at 11:17 PM
7 -- Server version: 5.0.56
8 -- PHP Version: 5.2.6RC4-pl0-gentoo
11 -- Database: `b`
14 -- --------------------------------------------------------
17 -- Table structure for table `categories`
20 CREATE TABLE IF NOT EXISTS `categories` (
21   `category_id` tinyint(4) NOT NULL auto_increment,
22   `category_parent` int(11) default NULL,
23   `category_name` varchar(255) NOT NULL,
24   `category_description` tinytext NOT NULL,
25   `category_active` enum('Y','N') NOT NULL default 'Y',
26   `category_private` enum('Y','N') NOT NULL default 'N',
27   PRIMARY KEY  (`category_id`),
28   KEY `category_parent` (`category_parent`)
29 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
32 -- Dumping data for table `categories`
35 INSERT INTO `categories` (`category_id`, `category_parent`, `category_name`, `category_description`, `category_active`, `category_private`) VALUES
36 (1, NULL, 'about : tests', '', 'Y', 'N');
38 -- --------------------------------------------------------
41 -- Table structure for table `categories_posts`
44 CREATE TABLE IF NOT EXISTS "categories_posts" (
45   "cp_id" int(11) NOT NULL auto_increment,
46   "category_id" tinyint(4) NOT NULL,
47   "post_id" int(11) NOT NULL,
48   PRIMARY KEY  ("cp_id"),
49   UNIQUE KEY "unique_cat_post" ("category_id","post_id")
52 -- --------------------------------------------------------
55 -- Table structure for table `groups`
58 CREATE TABLE IF NOT EXISTS "groups" (
59   "group_id" tinyint(4) NOT NULL auto_increment,
60   "group_name" varchar(50) NOT NULL,
61   PRIMARY KEY  ("group_id")
62 ) AUTO_INCREMENT=3 ;
65 -- Dumping data for table `groups`
68 INSERT INTO `groups` (`group_id`, `group_name`) VALUES
69 (1, 'root'),
70 (2, 'guest');
72 -- --------------------------------------------------------
75 -- Table structure for table `groups_roles`
78 CREATE TABLE IF NOT EXISTS "groups_roles" (
79   "gr_id" tinyint(4) NOT NULL auto_increment,
80   "group_id" tinyint(4) NOT NULL,
81   "role_id" tinyint(4) NOT NULL,
82   PRIMARY KEY  ("gr_id"),
83   UNIQUE KEY "group_id" ("group_id","role_id")
84 ) AUTO_INCREMENT=3 ;
87 -- Dumping data for table `groups_roles`
90 INSERT INTO `groups_roles` (`gr_id`, `group_id`, `role_id`) VALUES
91 (1, 1, 1),
92 (2, 1, 2);
94 -- --------------------------------------------------------
97 -- Table structure for table `options`
100 CREATE TABLE IF NOT EXISTS `options` (
101   `option_id` tinyint(4) NOT NULL auto_increment,
102   `option_name` varchar(12) NOT NULL,
103   `option_value` varchar(255) NOT NULL,
104   `option_modif` enum('Y','N') default 'N',
105   PRIMARY KEY  (`option_id`),
106   UNIQUE KEY `option_name` (`option_name`)
107 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
110 -- Dumping data for table `options`
113 INSERT INTO `options` (`option_id`, `option_name`, `option_value`, `option_modif`) VALUES
114 (1, 'title', 'empty spaces ...', 'Y'),
115 (2, 'start', '2008-01-20', 'N');
117 -- --------------------------------------------------------
120 -- Table structure for table `posts`
123 CREATE TABLE IF NOT EXISTS `posts` (
124   `post_id` int(10) NOT NULL auto_increment,
125   `post_time` timestamp NOT NULL default CURRENT_TIMESTAMP,
126   `post_title` varchar(250) collate utf8_unicode_ci NOT NULL,
127   `post_author` int(11) NOT NULL,
128   `post_body` text collate utf8_unicode_ci NOT NULL,
129   `post_active` enum('Y','N') collate utf8_unicode_ci default 'Y',
130   `post_private` enum('Y','N') collate utf8_unicode_ci NOT NULL default 'N',
131   PRIMARY KEY  (`post_id`),
132   KEY `post_time` (`post_time`),
133   KEY `post_flags` (`post_private`),
134   KEY `post_author` (`post_author`),
135   FULLTEXT KEY `post_body` (`post_body`)
136 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
138 -- --------------------------------------------------------
141 -- Table structure for table `roles`
144 CREATE TABLE IF NOT EXISTS "roles" (
145   "role_id" tinyint(4) NOT NULL auto_increment,
146   "role_name" varchar(50) NOT NULL,
147   PRIMARY KEY  ("role_id")
148 ) AUTO_INCREMENT=3 ;
151 -- Dumping data for table `roles`
154 INSERT INTO `roles` (`role_id`, `role_name`) VALUES
155 (1, 'all'),
156 (2, 'nothing');
158 -- --------------------------------------------------------
161 -- Table structure for table `users`
164 CREATE TABLE IF NOT EXISTS "users" (
165   "user_id" int(11) NOT NULL auto_increment,
166   "user_name" varchar(16) NOT NULL,
167   "user_email" varchar(50) NOT NULL,
168   "user_credentials" varchar(32) NOT NULL,
169   PRIMARY KEY  ("user_id")
170 ) AUTO_INCREMENT=2 ;
173 -- Dumping data for table `users`
176 INSERT INTO `users` (`user_id`, `user_name`, `user_email`, `user_credentials`) VALUES
177 (1, 'habarnam', 'hab@habarnam.ro', '83b35b5d298c51c9b43f533847363c26');
179 -- --------------------------------------------------------
182 -- Table structure for table `users_groups`
185 CREATE TABLE IF NOT EXISTS "users_groups" (
186   "ug_id" int(11) NOT NULL auto_increment,
187   "user_id" int(11) NOT NULL,
188   "group_id" tinyint(4) NOT NULL,
189   PRIMARY KEY  ("ug_id"),
190   UNIQUE KEY "user_group" ("user_id","group_id")
191 ) AUTO_INCREMENT=2 ;
194 -- Dumping data for table `users_groups`
197 INSERT INTO `users_groups` (`ug_id`, `user_id`, `group_id`) VALUES
198 (1, 1, 1);