Ticket #226: aliasBugsSchemaMySQL.txt

File aliasBugsSchemaMySQL.txt, 5.5 kB (added by Bryan S, 19 years ago)

The sql to create my schema in MySql?

Line 
1/*==============================================================*/
2/* DBMS name:      MySQL 3.22                                   */
3/* Created on:     10/23/2006 2:42:09 PM                        */
4/*==============================================================*/
5
6
7drop index APM_APR01_FK on APP_ROLE;
8
9drop index RLM_APR01_FK on APP_ROLE;
10
11drop index GRM_GRU01_FK on GROUP_USER;
12
13drop index USM_GRU01_FK on GROUP_USER;
14
15drop index GRM_RGR01_FK on ROLE_GROUP;
16
17drop index RLM_RLG01_FK on ROLE_GROUP;
18
19drop table if exists APP_MAIN;
20
21drop table if exists APP_ROLE;
22
23drop table if exists GROUP_MAIN;
24
25drop table if exists GROUP_USER;
26
27drop table if exists ROLE_GROUP;
28
29drop table if exists ROLE_MAIN;
30
31drop table if exists USER_MAIN;
32
33/*==============================================================*/
34/* Table: APP_MAIN                                              */
35/*==============================================================*/
36create table APP_MAIN
37(
38   APM_APP_MAIN_ID                int                            not null AUTO_INCREMENT,
39   APM_APP_NAME                   national varchar(25),
40   APM_COLUMN_2                   national varchar(25),
41   APM_COLUMN_3                   national varchar(25),
42   APM_COLUMN_4                   national varchar(25),
43   primary key (APM_APP_MAIN_ID)
44);
45
46/*==============================================================*/
47/* Table: APP_ROLE                                              */
48/*==============================================================*/
49create table APP_ROLE
50(
51   APR_APP_ROLE_ID                int                            not null AUTO_INCREMENT,
52   APR_APP_MAIN_ID                int,
53   APR_ROLE_MAIN_ID               int,
54   primary key (APR_APP_ROLE_ID)
55);
56
57/*==============================================================*/
58/* Index: APM_APR01_FK                                          */
59/*==============================================================*/
60create index APM_APR01_FK on APP_ROLE
61(
62   APR_APP_MAIN_ID
63);
64
65/*==============================================================*/
66/* Index: RLM_APR01_FK                                          */
67/*==============================================================*/
68create index RLM_APR01_FK on APP_ROLE
69(
70   APR_ROLE_MAIN_ID
71);
72
73/*==============================================================*/
74/* Table: GROUP_MAIN                                            */
75/*==============================================================*/
76create table GROUP_MAIN
77(
78   GRM_GROUP_MAIN_ID              int                            not null AUTO_INCREMENT,
79   GRM_GROUP_NAME                 national varchar(25),
80   primary key (GRM_GROUP_MAIN_ID)
81);
82
83/*==============================================================*/
84/* Table: GROUP_USER                                            */
85/*==============================================================*/
86create table GROUP_USER
87(
88   GRU_GROUP_USER_ID              int                            not null AUTO_INCREMENT,
89   GRU_GROUP_MAIN_ID              int,
90   GRU_USER_MAIN_ID               int,
91   primary key (GRU_GROUP_USER_ID)
92);
93
94/*==============================================================*/
95/* Index: GRM_GRU01_FK                                          */
96/*==============================================================*/
97create index GRM_GRU01_FK on GROUP_USER
98(
99   GRU_GROUP_MAIN_ID
100);
101
102/*==============================================================*/
103/* Index: USM_GRU01_FK                                          */
104/*==============================================================*/
105create index USM_GRU01_FK on GROUP_USER
106(
107   GRU_USER_MAIN_ID
108);
109
110/*==============================================================*/
111/* Table: ROLE_GROUP                                            */
112/*==============================================================*/
113create table ROLE_GROUP
114(
115   RLG_ROLE_GROUP_ID              int                            not null AUTO_INCREMENT,
116   RLG_ROLE_MAIN_ID               int,
117   RLG_GROUP_MAIN_ID              int,
118   primary key (RLG_ROLE_GROUP_ID)
119);
120
121/*==============================================================*/
122/* Index: RLM_RLG01_FK                                          */
123/*==============================================================*/
124create index RLM_RLG01_FK on ROLE_GROUP
125(
126   RLG_ROLE_MAIN_ID
127);
128
129/*==============================================================*/
130/* Index: GRM_RGR01_FK                                          */
131/*==============================================================*/
132create index GRM_RGR01_FK on ROLE_GROUP
133(
134   RLG_GROUP_MAIN_ID
135);
136
137/*==============================================================*/
138/* Table: ROLE_MAIN                                             */
139/*==============================================================*/
140create table ROLE_MAIN
141(
142   RLM_ROLE_MAIN_ID               int                            not null AUTO_INCREMENT,
143   RLM_ROLE_NAME                  national varchar(25),
144   primary key (RLM_ROLE_MAIN_ID)
145);
146
147/*==============================================================*/
148/* Table: USER_MAIN                                             */
149/*==============================================================*/
150create table USER_MAIN
151(
152   USM_USER_MAIN_ID               int                            not null AUTO_INCREMENT,
153   USM_USER_LOGIN                 national varchar(25),
154   primary key (USM_USER_MAIN_ID)
155);
156