Skip to content

Commit 635c648

Browse files
committed
Add ddl files for creating db and tables
1 parent 2967c01 commit 635c648

23 files changed

+314
-0
lines changed

_sql/mssql/create.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
osql -U sa -P -i quickfix_database.sql

_sql/mssql/quickfix_database.sql

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
DROP DATABASE quickfix;
2+
CREATE DATABASE quickfix;
3+
4+
USE quickfix;
5+
CREATE TABLE sessions (
6+
beginstring CHAR(8) NOT NULL,
7+
sendercompid VARCHAR(64) NOT NULL,
8+
sendersubid VARCHAR(64) NOT NULL,
9+
senderlocid VARCHAR(64) NOT NULL,
10+
targetcompid VARCHAR(64) NOT NULL,
11+
targetsubid VARCHAR(64) NOT NULL,
12+
targetlocid VARCHAR(64) NOT NULL,
13+
session_qualifier VARCHAR(64) NOT NULL,
14+
creation_time DATETIME NOT NULL,
15+
incoming_seqnum INT NOT NULL,
16+
outgoing_seqnum INT NOT NULL,
17+
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
18+
targetcompid, targetsubid, targetlocid, session_qualifier)
19+
);
20+
21+
CREATE TABLE messages (
22+
beginstring CHAR(8) NOT NULL,
23+
sendercompid VARCHAR(64) NOT NULL,
24+
sendersubid VARCHAR(64) NOT NULL,
25+
senderlocid VARCHAR(64) NOT NULL,
26+
targetcompid VARCHAR(64) NOT NULL,
27+
targetsubid VARCHAR(64) NOT NULL,
28+
targetlocid VARCHAR(64) NOT NULL,
29+
session_qualifier VARCHAR(64) NOT NULL,
30+
msgseqnum INT NOT NULL,
31+
message TEXT NOT NULL,
32+
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
33+
targetcompid, targetsubid, targetlocid, session_qualifier,
34+
msgseqnum)
35+
);
36+
37+
CREATE TABLE event_log (
38+
id INT NOT NULL IDENTITY,
39+
time DATETIME NOT NULL,
40+
beginstring CHAR(8) NOT NULL,
41+
sendercompid VARCHAR(64) NOT NULL,
42+
sendersubid VARCHAR(64) NOT NULL,
43+
senderlocid VARCHAR(64) NOT NULL,
44+
targetcompid VARCHAR(64) NOT NULL,
45+
targetsubid VARCHAR(64) NOT NULL,
46+
targetlocid VARCHAR(64) NOT NULL,
47+
session_qualifier VARCHAR(64) NOT NULL,
48+
text TEXT NOT NULL,
49+
PRIMARY KEY (id)
50+
);
51+
52+
CREATE TABLE messages_log (
53+
id INT NOT NULL IDENTITY,
54+
time DATETIME NOT NULL,
55+
beginstring CHAR(8) NOT NULL,
56+
sendercompid VARCHAR(64) NOT NULL,
57+
sendersubid VARCHAR(64) NOT NULL,
58+
senderlocid VARCHAR(64) NOT NULL,
59+
targetcompid VARCHAR(64) NOT NULL,
60+
targetsubid VARCHAR(64) NOT NULL,
61+
targetlocid VARCHAR(64) NOT NULL,
62+
session_qualifier VARCHAR(64) NOT NULL,
63+
text TEXT NOT NULL,
64+
PRIMARY KEY (id)
65+
);

_sql/mysql/create.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mysql -u root --execute="source mysql.sql";

_sql/mysql/create.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mysql -u root --execute="source mysql.sql";

_sql/mysql/event_log_table.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
USE quickfix;
2+
3+
DROP TABLE IF EXISTS event_log;
4+
5+
CREATE TABLE event_log (
6+
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
7+
time DATETIME NOT NULL,
8+
beginstring CHAR(8) NOT NULL,
9+
sendercompid VARCHAR(64) NOT NULL,
10+
sendersubid VARCHAR(64) NOT NULL,
11+
senderlocid VARCHAR(64) NOT NULL,
12+
targetcompid VARCHAR(64) NOT NULL,
13+
targetsubid VARCHAR(64) NOT NULL,
14+
targetlocid VARCHAR(64) NOT NULL,
15+
session_qualifier VARCHAR(64),
16+
text TEXT NOT NULL,
17+
PRIMARY KEY (id)
18+
);

_sql/mysql/messages_log_table.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
USE quickfix;
2+
3+
DROP TABLE IF EXISTS messages_log;
4+
5+
CREATE TABLE messages_log (
6+
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
7+
time DATETIME NOT NULL,
8+
beginstring CHAR(8) NOT NULL,
9+
sendercompid VARCHAR(64) NOT NULL,
10+
sendersubid VARCHAR(64) NOT NULL,
11+
senderlocid VARCHAR(64) NOT NULL,
12+
targetcompid VARCHAR(64) NOT NULL,
13+
targetsubid VARCHAR(64) NOT NULL,
14+
targetlocid VARCHAR(64) NOT NULL,
15+
session_qualifier VARCHAR(64) NOT NULL,
16+
text TEXT NOT NULL,
17+
PRIMARY KEY (id)
18+
);

_sql/mysql/messages_table.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
USE quickfix;
2+
3+
DROP TABLE IF EXISTS messages;
4+
5+
CREATE TABLE messages (
6+
beginstring CHAR(8) NOT NULL,
7+
sendercompid VARCHAR(64) NOT NULL,
8+
sendersubid VARCHAR(64) NOT NULL,
9+
senderlocid VARCHAR(64) NOT NULL,
10+
targetcompid VARCHAR(64) NOT NULL,
11+
targetsubid VARCHAR(64) NOT NULL,
12+
targetlocid VARCHAR(64) NOT NULL,
13+
session_qualifier VARCHAR(64) NOT NULL,
14+
msgseqnum INT NOT NULL,
15+
message TEXT NOT NULL,
16+
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
17+
targetcompid, targetsubid, targetlocid, session_qualifier,
18+
msgseqnum)
19+
);

_sql/mysql/mysql.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source quickfix_database.sql;
2+
source sessions_table.sql;
3+
source messages_table.sql;
4+
source messages_log_table.sql;
5+
source event_log_table.sql;

_sql/mysql/quickfix_database.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROP DATABASE IF EXISTS quickfix;
2+
CREATE DATABASE quickfix;

_sql/mysql/sessions_table.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
USE quickfix;
2+
3+
DROP TABLE IF EXISTS sessions;
4+
5+
CREATE TABLE sessions (
6+
beginstring CHAR(8) NOT NULL,
7+
sendercompid VARCHAR(64) NOT NULL,
8+
sendersubid VARCHAR(64) NOT NULL,
9+
senderlocid VARCHAR(64) NOT NULL,
10+
targetcompid VARCHAR(64) NOT NULL,
11+
targetsubid VARCHAR(64) NOT NULL,
12+
targetlocid VARCHAR(64) NOT NULL,
13+
session_qualifier VARCHAR(64) NOT NULL,
14+
creation_time DATETIME NOT NULL,
15+
incoming_seqnum INT NOT NULL,
16+
outgoing_seqnum INT NOT NULL,
17+
PRIMARY KEY (beginstring, sendercompid, sendersubid, senderlocid,
18+
targetcompid, targetsubid, targetlocid, session_qualifier)
19+
);

0 commit comments

Comments
 (0)