Browse Source

created table domain_settings

Karel Kozlik 19 years ago
parent
commit
fd7dba07e1

+ 116 - 0
db/schema/domain_settings.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE table PUBLIC "-//iptel.org//DTD DBSchema V1.0//EN"
+  "http://iptel.org/dbschema/dtd/1.0/dbschema.dtd" [
+
+<!ENTITY % entities SYSTEM "entities.xml">
+%entities;
+
+]>
+
+<table xmlns:my="http://iptel.org/dbschema/mysql"
+    xmlns:pg="http://iptel.org/dbschema/postgres"
+    xmlns:dt="http://iptel.org/dbschema/dbtext"
+    xmlns:db="http://docbook.org/ns/docbook"
+    role="serweb">
+    <name>domain_settings</name>
+    <version>1</version>
+
+    <description>
+	Domain specific files and their older versions.
+    </description>
+    <column id="ds.did">
+	<name>did</name>
+	<type>string</type>
+	<size>&id_len;</size>
+        <description>
+            Unique identifier of the domain.
+        </description>
+    </column>
+
+    <column id="ds.filename">
+	<name>filename</name>
+	<type>string</type>
+	<size>255</size>
+	<description>
+	    Name of file (within domain directory)
+	</description>
+    </column>
+
+    <column id="ds.version">
+	<name>version</name>
+	<type>unsigned int</type>
+	<description>
+	    Version of file
+	</description>
+    </column>
+
+    <column>
+	<name>timestamp</name>
+	<type>unsigned int</type>
+	<null/>
+	<description>
+	   Timestamp of creation this version of file 
+	</description>
+    </column>
+
+    <column>
+	<name>content</name>
+	<type>binary</type>
+	<null/>
+	<description>
+	    Content of file
+	</description>
+    </column>
+
+    <column>
+	<name>flags</name>
+        <type>unsigned int</type>
+	<default>0</default>
+        <description>
+	    Flags which describes some special meanings of rows. Meaning of flags is summarized in the table below.
+            <db:table>
+                <db:tgroup>
+                    <db:thead>
+                        <db:row>
+                           <db:entry>Bit</db:entry>
+                           <db:entry>Hex value</db:entry>
+                           <db:entry>Flag</db:entry>
+                           <db:entry>Description</db:entry>
+                        </db:row>
+                    </db:thead>
+                    <db:tbody>
+                        <db:row>
+                           <db:entry>0</db:entry>
+                           <db:entry>0x00000001</db:entry>
+                           <db:entry>DELETED</db:entry>
+                           <db:entry>
+                               File has been deleted.
+                           </db:entry>
+                        </db:row>
+                        <db:row>
+                           <db:entry>1</db:entry>
+                           <db:entry>0x00000002</db:entry>
+                           <db:entry>DIR</db:entry>
+                           <db:entry>
+			       This is a directory.
+                           </db:entry>
+                        </db:row>
+                    </db:tbody>
+                </db:tgroup>
+            </db:table>
+	</description>
+    </column>
+    
+    <index>
+	<name>ds_id</name>
+	<unique/>
+	<colref linkend="ds.did"/>
+	<colref linkend="ds.filename"/>
+	<colref linkend="ds.version"/>
+    </index>
+    <index>
+	<name>ds_df</name>
+	<colref linkend="ds.did"/>
+	<colref linkend="ds.filename"/>
+    </index>
+</table>

+ 3 - 0
db/schema/ser.xml

@@ -35,6 +35,9 @@
     <!-- Multi-domain support -->
     <!-- Multi-domain support -->
     <xi:include href="domain.xml"/>
     <xi:include href="domain.xml"/>
 
 
+    <!-- Table containing text files, styles and other files specific for domain (used by serweb) -->
+    <xi:include href="domain_settings.xml"/>
+
     <!-- User location database -->
     <!-- User location database -->
     <xi:include href="location.xml"/>
     <xi:include href="location.xml"/>
 
 

+ 1 - 0
scripts/dbtext/ser_db/domain_settings

@@ -0,0 +1 @@
+did(str) filename(str) version(int) timestamp(int,null) content(str,null) flags(int) 

+ 12 - 0
scripts/mysql/my_create.sql

@@ -168,6 +168,18 @@ CREATE TABLE domain (
     UNIQUE KEY domain_idx (domain)
     UNIQUE KEY domain_idx (domain)
 );
 );
 
 
+INSERT INTO version (table_name, table_version) values ('domain_settings','1');
+CREATE TABLE domain_settings (
+    did VARCHAR(64) NOT NULL,
+    filename VARCHAR(255) NOT NULL,
+    version INT UNSIGNED NOT NULL,
+    timestamp INT UNSIGNED,
+    content BLOB,
+    flags INT UNSIGNED NOT NULL DEFAULT '0',
+    UNIQUE KEY ds_id (did, filename, version),
+    KEY ds_df (did, filename)
+);
+
 INSERT INTO version (table_name, table_version) values ('location','8');
 INSERT INTO version (table_name, table_version) values ('location','8');
 CREATE TABLE location (
 CREATE TABLE location (
     uid VARCHAR(64) NOT NULL,
     uid VARCHAR(64) NOT NULL,

+ 12 - 0
scripts/oracle/or_create.sql

@@ -166,6 +166,18 @@ CREATE TABLE domain (
     domain_idx UNIQUE (domain, )
     domain_idx UNIQUE (domain, )
 );
 );
 
 
+INSERT INTO version (table_name, table_version) values ('domain_settings','1');
+CREATE TABLE domain_settings (
+    did string(64) NOT NULL,
+    filename string(255) NOT NULL,
+    version int NOT NULL,
+    timestamp int,
+    content binary,
+    flags int NOT NULL DEFAULT '0',
+    ds_id UNIQUE (did, filename, version, ),
+
+);
+
 INSERT INTO version (table_name, table_version) values ('location','8');
 INSERT INTO version (table_name, table_version) values ('location','8');
 CREATE TABLE location (
 CREATE TABLE location (
     uid string(64) NOT NULL,
     uid string(64) NOT NULL,

+ 12 - 0
scripts/postgres/pg_create.sql

@@ -165,6 +165,18 @@ CREATE TABLE domain (
     CONSTRAINT domain_idx UNIQUE (domain)
     CONSTRAINT domain_idx UNIQUE (domain)
 );
 );
 
 
+CREATE TABLE domain_settings (
+    did VARCHAR(64) NOT NULL,
+    filename VARCHAR(255) NOT NULL,
+    version INTEGER NOT NULL,
+    timestamp INTEGER,
+    content BYTEA,
+    flags INTEGER NOT NULL DEFAULT '0',
+    CONSTRAINT ds_id UNIQUE (did, filename, version)
+);
+
+CREATE INDEX ds_df ON domain_settings (did, filename);
+
 CREATE TABLE location (
 CREATE TABLE location (
     uid VARCHAR(64) NOT NULL,
     uid VARCHAR(64) NOT NULL,
     contact VARCHAR(255) NOT NULL,
     contact VARCHAR(255) NOT NULL,