Bläddra i källkod

Added table 'customers'

Karel Kozlik 19 år sedan
förälder
incheckning
14bf4fda0e

+ 78 - 0
db/schema/customers.xml

@@ -0,0 +1,78 @@
+<?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"
+    role="serweb">
+    <name>customers</name>
+    <version>1</version>
+
+    <description>
+	Customers - domain owners (among others that's the party to be billed for having a domain).
+	Customers are entities that describe the commercial owners of domains.
+    </description>
+    <column id="cu.cid">
+	<name>cid</name>
+	<type>unsigned int</type>
+	<my:type>INT AUTO_INCREMENT</my:type>
+	<pg:type>SERIAL</pg:type>
+	<dt:type>int,auto</dt:type>
+	<description>
+	    Unique id of the customer. The value is auto generated by the databsae
+	    server.
+	</description>
+    </column>
+
+    <column>
+	<name>name</name>
+	<type>string</type>
+	<size>128</size>
+	<description>
+	    Name of the customer.
+	</description>
+    </column>
+
+    <column>
+	<name>address</name>
+	<type>string</type>
+	<size>255</size>
+	<null/>
+	<description>
+	    Address of the customer.
+	</description>
+    </column>
+
+    <column>
+	<name>phone</name>
+	<type>string</type>
+	<size>64</size>
+	<null/>
+	<description>
+	    Phone number of the customer.
+	</description>
+    </column>
+
+    <column>
+	<name>email</name>
+	<type>string</type>
+	<size>255</size>
+	<null/>
+	<description>
+	    Email address of the customer.
+        </description>
+    </column>
+							    
+
+    <index>
+	<name>cu_idx</name>
+	<unique/>
+	<colref linkend="cu.cid"/>
+    </index>
+</table>

+ 5 - 0
db/schema/ser.xml

@@ -80,6 +80,11 @@
 
 
     <xi:include href="pdt.xml"/>
     <xi:include href="pdt.xml"/>
 
 
+
+    <!-- Customers -->
+    <xi:include href="customers.xml"/>
+
+
     <!-- Include extra definitions if found, it is not
     <!-- Include extra definitions if found, it is not
          an error if they are not present, although it
          an error if they are not present, although it
          would produce a warning
          would produce a warning

+ 6 - 0
db/schema/version.xml

@@ -123,4 +123,10 @@
 	<value col="tn"><xi:include href="pdt.xml" xpointer="xpointer(table/name/text())"/></value>
 	<value col="tn"><xi:include href="pdt.xml" xpointer="xpointer(table/name/text())"/></value>
 	<value col="tv"><xi:include href="pdt.xml" xpointer="xpointer(table/version/text())"/></value>
 	<value col="tv"><xi:include href="pdt.xml" xpointer="xpointer(table/version/text())"/></value>
     </row>
     </row>
+
+    <row>
+        <value col="tn"><xi:include href="customers.xml" xpointer="xpointer(table/name/text())"/></value>
+        <value col="tv"><xi:include href="customers.xml" xpointer="xpointer(table/version/text())"/></value>
+    </row>
+			
 </table>
 </table>

+ 1 - 0
scripts/dbtext/ser_db/customers

@@ -0,0 +1 @@
+cid(int,auto) name(str) address(str,null) phone(str,null) email(str,null) 

+ 1 - 0
scripts/dbtext/ser_db/version

@@ -24,3 +24,4 @@ presentity_contact:1
 watcherinfo:1
 watcherinfo:1
 i18n:1
 i18n:1
 pdt:1
 pdt:1
+customers:1

+ 10 - 0
scripts/mysql/my_create.sql

@@ -31,6 +31,7 @@ INSERT INTO version (table_name, table_version) VALUES ('presentity_contact', '1
 INSERT INTO version (table_name, table_version) VALUES ('watcherinfo', '1');
 INSERT INTO version (table_name, table_version) VALUES ('watcherinfo', '1');
 INSERT INTO version (table_name, table_version) VALUES ('i18n', '1');
 INSERT INTO version (table_name, table_version) VALUES ('i18n', '1');
 INSERT INTO version (table_name, table_version) VALUES ('pdt', '1');
 INSERT INTO version (table_name, table_version) VALUES ('pdt', '1');
+INSERT INTO version (table_name, table_version) VALUES ('customers', '1');
 
 
 CREATE TABLE acc (
 CREATE TABLE acc (
     id INT AUTO_INCREMENT NOT NULL,
     id INT AUTO_INCREMENT NOT NULL,
@@ -521,6 +522,15 @@ CREATE TABLE pdt (
     UNIQUE KEY pdt_idx (prefix)
     UNIQUE KEY pdt_idx (prefix)
 );
 );
 
 
+CREATE TABLE customers (
+    cid INT AUTO_INCREMENT NOT NULL,
+    name VARCHAR(128) NOT NULL,
+    address VARCHAR(255),
+    phone VARCHAR(64),
+    email VARCHAR(255),
+    UNIQUE KEY cu_idx (cid)
+);
+
 GRANT ALL ON ser.* TO 'ser'@'%' IDENTIFIED BY 'heslo';
 GRANT ALL ON ser.* TO 'ser'@'%' IDENTIFIED BY 'heslo';
 GRANT ALL ON ser.* TO 'ser'@'localhost' IDENTIFIED BY 'heslo';
 GRANT ALL ON ser.* TO 'ser'@'localhost' IDENTIFIED BY 'heslo';
 FLUSH PRIVILEGES;
 FLUSH PRIVILEGES;

+ 10 - 0
scripts/oracle/or_create.sql

@@ -28,6 +28,7 @@ INSERT INTO version (table_name, table_version) VALUES ('presentity_contact', '1
 INSERT INTO version (table_name, table_version) VALUES ('watcherinfo', '1');
 INSERT INTO version (table_name, table_version) VALUES ('watcherinfo', '1');
 INSERT INTO version (table_name, table_version) VALUES ('i18n', '1');
 INSERT INTO version (table_name, table_version) VALUES ('i18n', '1');
 INSERT INTO version (table_name, table_version) VALUES ('pdt', '1');
 INSERT INTO version (table_name, table_version) VALUES ('pdt', '1');
+INSERT INTO version (table_name, table_version) VALUES ('customers', '1');
 
 
 CREATE TABLE acc (
 CREATE TABLE acc (
     id int NOT NULL,
     id int NOT NULL,
@@ -503,3 +504,12 @@ CREATE TABLE pdt (
     pdt_idx UNIQUE (prefix, )
     pdt_idx UNIQUE (prefix, )
 );
 );
 
 
+CREATE TABLE customers (
+    cid int NOT NULL,
+    name string(128) NOT NULL,
+    address string(255),
+    phone string(64),
+    email string(255),
+    cu_idx UNIQUE (cid, )
+);
+

+ 10 - 0
scripts/postgres/pg_create.sql

@@ -28,6 +28,7 @@ INSERT INTO version (table_name, table_version) VALUES ('presentity_contact', '1
 INSERT INTO version (table_name, table_version) VALUES ('watcherinfo', '1');
 INSERT INTO version (table_name, table_version) VALUES ('watcherinfo', '1');
 INSERT INTO version (table_name, table_version) VALUES ('i18n', '1');
 INSERT INTO version (table_name, table_version) VALUES ('i18n', '1');
 INSERT INTO version (table_name, table_version) VALUES ('pdt', '1');
 INSERT INTO version (table_name, table_version) VALUES ('pdt', '1');
+INSERT INTO version (table_name, table_version) VALUES ('customers', '1');
 
 
 CREATE TABLE acc (
 CREATE TABLE acc (
     id SERIAL NOT NULL,
     id SERIAL NOT NULL,
@@ -536,3 +537,12 @@ CREATE TABLE pdt (
     CONSTRAINT pdt_idx UNIQUE (prefix)
     CONSTRAINT pdt_idx UNIQUE (prefix)
 );
 );
 
 
+CREATE TABLE customers (
+    cid SERIAL NOT NULL,
+    name VARCHAR(128) NOT NULL,
+    address VARCHAR(255),
+    phone VARCHAR(64),
+    email VARCHAR(255),
+    CONSTRAINT cu_idx UNIQUE (cid)
+);
+