home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / schema.sql < prev    next >
Encoding:
Text File  |  2004-07-12  |  1.3 KB  |  51 lines

  1.  
  2.  
  3. # Copyright 1999-2004 The Apache Software Foundation
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. #     http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16.  
  17. -- this is the hsqldb schema file
  18. -- to adapt it to another RDBMS, replace column type identity
  19. -- with appropriate autoincrement type, e.g. SERIAL for informix
  20. -- you might want to add "on delete cascade" to foreign keys in
  21. -- table user_groups
  22.  
  23. create table user (
  24.     uid integer identity primary key,
  25.     name varchar(50),
  26.     firstname varchar(50),
  27.     uname varchar(20),
  28.     unique (uname)
  29. );
  30. create table groups (
  31.     gid integer identity primary key,
  32.     gname varchar(20),
  33.     unique (gname)
  34. );
  35.  
  36. create table user_groups (
  37.     uid integer,
  38.     gid integer,
  39.     primary key (uid,gid),
  40.     foreign key (uid) references user(uid),
  41.     foreign key (gid) references groups(gid)
  42. );
  43.  
  44. create table media (
  45.     id integer identity primary key,
  46.     image varbinary,
  47.     mimetype varchar(50),
  48.     primary key (id)
  49. );
  50.  
  51.