Add visitors field to events for PATCH support
This commit is contained in:
parent
470fca9353
commit
309cf65ff4
4 changed files with 12 additions and 8 deletions
|
|
@ -109,11 +109,12 @@ CREATE TABLE `events` (
|
|||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`datetime` datetime(3) NOT NULL,
|
||||
`visitors` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
INSERT INTO `events` (`id`, `name`, `datetime`) VALUES
|
||||
(1, 'Launch', '2016-01-01 13:01:01.111');
|
||||
INSERT INTO `events` (`id`, `name`, `datetime`, `visitors`) VALUES
|
||||
(1, 'Launch', '2016-01-01 13:01:01.111', 0);
|
||||
|
||||
DROP VIEW IF EXISTS `tag_usage`;
|
||||
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`;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ CREATE TABLE countries (
|
|||
CREATE TABLE events (
|
||||
id serial NOT NULL,
|
||||
name character varying(255) NOT NULL,
|
||||
datetime timestamp NOT NULL
|
||||
datetime timestamp NOT NULL,
|
||||
visitors integer NOT NULL
|
||||
);
|
||||
|
||||
--
|
||||
|
|
@ -195,8 +196,8 @@ INSERT INTO "countries" ("name", "shape") VALUES
|
|||
-- Data for Name: events; Type: TABLE DATA; Schema: public; Owner: postgres
|
||||
--
|
||||
|
||||
INSERT INTO "events" ("name", "datetime") VALUES
|
||||
('Launch', '2016-01-01 13:01:01.111');
|
||||
INSERT INTO "events" ("name", "datetime", "visitors") VALUES
|
||||
('Launch', '2016-01-01 13:01:01.111', 0);
|
||||
|
||||
--
|
||||
-- Data for Name: events; Type: TABLE DATA; Schema: public; Owner: postgres
|
||||
|
|
|
|||
|
|
@ -92,10 +92,11 @@ DROP TABLE IF EXISTS `events`;
|
|||
CREATE TABLE `events` (
|
||||
`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`name` text(255) NOT NULL,
|
||||
`datetime` datetime NOT NULL
|
||||
`datetime` datetime NOT NULL,
|
||||
`visitors` integer NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO `events` (`id`, `name`, `datetime`) VALUES (1, 'Launch', '2016-01-01 13:01:01.111');
|
||||
INSERT INTO `events` (`id`, `name`, `datetime`, `visitors`) VALUES (1, 'Launch', '2016-01-01 13:01:01.111', 0);
|
||||
|
||||
DROP VIEW IF EXISTS `tag_usage`;
|
||||
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`;
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ CREATE TABLE [events](
|
|||
[id] [int] IDENTITY,
|
||||
[name] [nvarchar](max) NOT NULL,
|
||||
[datetime] [datetime2](3) NOT NULL,
|
||||
[visitors] [int] NOT NULL,
|
||||
CONSTRAINT [PK_events] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[id] ASC
|
||||
|
|
@ -280,7 +281,7 @@ SET IDENTITY_INSERT [countries] OFF
|
|||
GO
|
||||
SET IDENTITY_INSERT [events] ON
|
||||
GO
|
||||
INSERT [events] ([id], [name], [datetime]) VALUES (1, N'Launch', N'2016-01-01 13:01:01.111')
|
||||
INSERT [events] ([id], [name], [datetime], [visitors]) VALUES (1, N'Launch', N'2016-01-01 13:01:01.111', 0)
|
||||
GO
|
||||
SET IDENTITY_INSERT [events] OFF
|
||||
GO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue