Browse Source

Add visitors field to events for PATCH support

Maurits van der Schee 7 years ago
parent
commit
309cf65ff4
4 changed files with 12 additions and 8 deletions
  1. 3
    2
      tests/blog_mysql.sql
  2. 4
    3
      tests/blog_postgresql.sql
  3. 3
    2
      tests/blog_sqlite.sql
  4. 2
    1
      tests/blog_sqlserver.sql

+ 3
- 2
tests/blog_mysql.sql View File

@@ -109,11 +109,12 @@ CREATE TABLE `events` (
109 109
   `id` int(11) NOT NULL AUTO_INCREMENT,
110 110
   `name` varchar(255) NOT NULL,
111 111
   `datetime` datetime(3) NOT NULL,
112
+  `visitors` int(11) NOT NULL,
112 113
   PRIMARY KEY (`id`)
113 114
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
114 115
 
115
-INSERT INTO `events` (`id`, `name`, `datetime`) VALUES
116
-(1,	'Launch', '2016-01-01 13:01:01.111');
116
+INSERT INTO `events` (`id`, `name`, `datetime`, `visitors`) VALUES
117
+(1,	'Launch', '2016-01-01 13:01:01.111', 0);
117 118
 
118 119
 DROP VIEW IF EXISTS `tag_usage`;
119 120
 CREATE VIEW `tag_usage` AS select `name`, count(`name`) AS `count` from `tags`, `post_tags` where `tags`.`id` = `post_tags`.`tag_id` group by `name` order by `count` desc, `name`;

+ 4
- 3
tests/blog_postgresql.sql View File

@@ -112,7 +112,8 @@ CREATE TABLE countries (
112 112
 CREATE TABLE events (
113 113
     id serial NOT NULL,
114 114
     name character varying(255) NOT NULL,
115
-    datetime timestamp NOT NULL
115
+    datetime timestamp NOT NULL,
116
+    visitors integer NOT NULL
116 117
 );
117 118
 
118 119
 --
@@ -195,8 +196,8 @@ INSERT INTO "countries" ("name", "shape") VALUES
195 196
 -- Data for Name: events; Type: TABLE DATA; Schema: public; Owner: postgres
196 197
 --
197 198
 
198
-INSERT INTO "events" ("name", "datetime") VALUES
199
-('Launch',	'2016-01-01 13:01:01.111');
199
+INSERT INTO "events" ("name", "datetime", "visitors") VALUES
200
+('Launch',	'2016-01-01 13:01:01.111',	0);
200 201
 
201 202
 --
202 203
 -- Data for Name: events; Type: TABLE DATA; Schema: public; Owner: postgres

+ 3
- 2
tests/blog_sqlite.sql View File

@@ -92,10 +92,11 @@ DROP TABLE IF EXISTS `events`;
92 92
 CREATE TABLE `events` (
93 93
   `id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
94 94
   `name` text(255) NOT NULL,
95
-  `datetime` datetime NOT NULL
95
+  `datetime` datetime NOT NULL,
96
+  `visitors` integer NOT NULL
96 97
 );
97 98
 
98
-INSERT INTO `events` (`id`, `name`, `datetime`) VALUES (1,	'Launch',	'2016-01-01 13:01:01.111');
99
+INSERT INTO `events` (`id`, `name`, `datetime`, `visitors`) VALUES (1,	'Launch',	'2016-01-01 13:01:01.111',	0);
99 100
 
100 101
 DROP VIEW IF EXISTS `tag_usage`;
101 102
 CREATE VIEW `tag_usage` AS select `name`, count(`name`) AS `count` from `tags`, `post_tags` where `tags`.`id` = `post_tags`.`tag_id` group by `name` order by `count` desc, `name`;

+ 2
- 1
tests/blog_sqlserver.sql View File

@@ -183,6 +183,7 @@ CREATE TABLE [events](
183 183
 	[id] [int] IDENTITY,
184 184
 	[name] [nvarchar](max) NOT NULL,
185 185
 	[datetime] [datetime2](3) NOT NULL,
186
+	[visitors] [int] NOT NULL,
186 187
  CONSTRAINT [PK_events] PRIMARY KEY CLUSTERED
187 188
 (
188 189
 	[id] ASC
@@ -280,7 +281,7 @@ SET IDENTITY_INSERT [countries] OFF
280 281
 GO
281 282
 SET IDENTITY_INSERT [events] ON
282 283
 GO
283
-INSERT [events] ([id], [name], [datetime]) VALUES (1, N'Launch', N'2016-01-01 13:01:01.111')
284
+INSERT [events] ([id], [name], [datetime], [visitors]) VALUES (1, N'Launch', N'2016-01-01 13:01:01.111', 0)
284 285
 GO
285 286
 SET IDENTITY_INSERT [events] OFF
286 287
 GO

Loading…
Cancel
Save