CREATE TABLE `event` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`venue_id` int(10) unsigned NOT NULL,
`movie_id` int(10) unsigned NOT NULL,
`date` date NOT NULL,
`time` time NOT NULL,
`url` varchar(255) DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `event` (`venue_id`,`movie_id`,`date`,`time`),
KEY `movie_id` (`movie_id`),
CONSTRAINT `event_ibfk_4` FOREIGN KEY (`movie_id`) REFERENCES `movie` (`id`) ON DELETE CASCADE,
CONSTRAINT `event_ibfk_5` FOREIGN KEY (`venue_id`) REFERENCES `venue` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1487 DEFAULT CHARSET=utf8;
SELECT * FROM event
returns date as (e.g.):
2017-02-24T00:00:00.000Z
2017-02-25T00:00:00.000Z
2017-02-26T00:00:00.000Z
2017-02-27T00:00:00.000Z
2017-02-28T00:00:00.000Z
2017-03-02T00:00:00.000Z
Shouldn't it just return YYYY-MM-DD?
Sorry, I just realised that it is returning an Object, which then gets stringified.
This is documented as dateStrings configuration.
Most helpful comment
This is documented as
dateStringsconfiguration.https://github.com/mysqljs/mysql