Browse code

Merge pull request #539 from smititelu/master

rtpengine: Add timestamp column to rtpengine table

Stefan Mititelu authored on 21/03/2016 09:42:57
Showing 10 changed files
... ...
@@ -50,6 +50,14 @@
50 50
         <natural/>
51 51
     </column>
52 52
 
53
+    <column id="stamp">
54
+        <name>stamp</name>
55
+        <type>datetime</type>
56
+        <description>RTPEngine instance add timestamp</description>
57
+        <default>1900-01-01 00:00:01</default>
58
+        <natural/>
59
+    </column>
60
+
53 61
     <index>
54 62
         <name>rtpengine_nodes</name>
55 63
         <colref linkend="setid"/>
... ...
@@ -511,22 +511,23 @@ modparam("rtpengine", "table_name", "rtpengine_table_name")
511 511
 		<title>Setup <varname>rtpengine</varname> table</title>
512 512
 <programlisting format="linespecific">
513 513
 mysql> describe rtpengine;
514
-+----------+------------------+------+-----+---------+-------+
515
-| Field    | Type             | Null | Key | Default | Extra |
516
-+----------+------------------+------+-----+---------+-------+
517
-| setid    | int(10) unsigned | NO   |     | NULL    |       |
518
-| url      | varchar(256)     | NO   |     | NULL    |       |
519
-| weight   | int(10) unsigned | NO   |     | NULL    |       |
520
-| disabled | int(11)          | NO   |     | NULL    |       |
521
-+----------+------------------+------+-----+---------+-------+
514
++----------+------------------+------+-----+---------------------+-------+
515
+| Field    | Type             | Null | Key | Default             | Extra |
516
++----------+------------------+------+-----+---------------------+-------+
517
+| setid    | int(10) unsigned | NO   | PRI | 0                   |       |
518
+| url      | varchar(64)      | NO   | PRI | NULL                |       |
519
+| weight   | int(10) unsigned | NO   |     | 1                   |       |
520
+| disabled | int(1)           | NO   |     | 0                   |       |
521
+| stamp    | datetime         | NO   |     | 1900-01-01 00:00:01 |       |
522
++----------+------------------+------+-----+---------------------+-------+
522 523
 
523 524
 mysql> select * from rtpengine;
524
-+-------+---------------------------+--------+----------+
525
-| setid | url                       | weight | disabled |
526
-+-------+---------------------------+--------+----------+
527
-|     0 | udp:rtpproxy1.domain:8800 |    100 |        0 |
528
-|     0 | udp:rtpproxy2.domain:8800 |    200 |        1 |
529
-+-------+---------------------------+--------+----------+
525
++-------+---------------------------+--------+----------+---------------------+
526
+| setid | url                       | weight | disabled | stamp               |
527
++-------+---------------------------+--------+----------+---------------------+
528
+|     0 | udp:rtpproxy1.domain:8800 |      1 |        0 | 2016-03-10 10:30:54 |
529
+|     0 | udp:rtpproxy2.domain:8800 |      1 |        1 | 2016-03-10 10:30:54 |
530
++-------+---------------------------+--------+----------+---------------------+
530 531
 
531 532
 mysql> select * from version;
532 533
 +---------------------------+---------------+
... ...
@@ -1,10 +1,10 @@
1 1
 METADATA_COLUMNS
2
-setid(int) url(str) weight(int) disabled(int)
2
+setid(int) url(str) weight(int) disabled(int) stamp(datetime)
3 3
 METADATA_KEY
4
-0 2 3
4
+0 2 3 4
5 5
 METADATA_READONLY
6 6
 0
7 7
 METADATA_LOGFLAGS
8 8
 0
9 9
 METADATA_DEFAULTS
10
-0|NIL|1|0
10
+0|NIL|1|0|'1900-01-01 00:00:01'
... ...
@@ -3,6 +3,7 @@ CREATE TABLE rtpengine (
3 3
     url VARCHAR(64) NOT NULL,
4 4
     weight INTEGER DEFAULT 1 NOT NULL,
5 5
     disabled INTEGER DEFAULT 0 NOT NULL,
6
+    stamp TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL,
6 7
     CONSTRAINT rtpengine_rtpengine_nodes PRIMARY KEY  (setid, url)
7 8
 );
8 9
 
... ...
@@ -1 +1 @@
1
-setid(int) url(string) weight(int) disabled(int) 
1
+setid(int) url(string) weight(int) disabled(int) stamp(int) 
... ...
@@ -3,6 +3,7 @@ CREATE TABLE `rtpengine` (
3 3
     `url` VARCHAR(64) NOT NULL,
4 4
     `weight` INT(10) UNSIGNED DEFAULT 1 NOT NULL,
5 5
     `disabled` INT(1) DEFAULT 0 NOT NULL,
6
+    `stamp` DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
6 7
     CONSTRAINT rtpengine_nodes PRIMARY KEY  (`setid`, `url`)
7 8
 );
8 9
 
... ...
@@ -3,6 +3,7 @@ CREATE TABLE rtpengine (
3 3
     url VARCHAR2(64),
4 4
     weight NUMBER(10) DEFAULT 1 NOT NULL,
5 5
     disabled NUMBER(10) DEFAULT 0 NOT NULL,
6
+    stamp DATE DEFAULT '1900-01-01 00:00:01',
6 7
     CONSTRAINT rtpengine_rtpengine_nodes  PRIMARY KEY  (setid, url)
7 8
 );
8 9
 
... ...
@@ -3,6 +3,7 @@ CREATE TABLE rtpengine (
3 3
     url VARCHAR(64) NOT NULL,
4 4
     weight INTEGER DEFAULT 1 NOT NULL,
5 5
     disabled INTEGER DEFAULT 0 NOT NULL,
6
+    stamp TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL,
6 7
     CONSTRAINT rtpengine_rtpengine_nodes PRIMARY KEY  (setid, url)
7 8
 );
8 9
 
... ...
@@ -8,6 +8,7 @@
8 8
 				<col><field>url</field></col>
9 9
 				<col><field>weight</field></col>
10 10
 				<col><field>disabled</field></col>
11
+				<col><field>stamp</field></col>
11 12
 			</query_cols>
12 13
 		</cmd>
13 14
 		<cmd><cmd_name>add</cmd_name>
... ...
@@ -18,6 +19,7 @@
18 19
 				<col><field>url</field></col>
19 20
 				<col><field>weight</field></col>
20 21
 				<col><field>disabled</field></col>
22
+				<col><field>stamp</field></col>
21 23
 			</query_cols>
22 24
 		</cmd>
23 25
 	</mod>
... ...
@@ -6,4 +6,5 @@
6 6
 		<column><field>url</field><type>DB1_STR</type></column>
7 7
 		<column><field>weight</field><type>DB1_INT</type></column>
8 8
 		<column><field>disabled</field><type>DB1_INT</type></column>
9
+		<column><field>stamp</field><type>DB1_DATETIME</type></column>
9 10
 	</db_table>