Skip to content

Commit

Permalink
https://dev.mysql.com/doc/refman/5.7/en/datetime.html
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Apr 17, 2017
1 parent 7340013 commit 4bb8aa7
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions _install/data/sql/MySQL/pH7_Core.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CREATE TABLE IF NOT EXISTS pH7_Members (
password varchar(120) NOT NULL,
firstName varchar(50) DEFAULT NULL,
lastName varchar(50) DEFAULT NULL,
birthDate date NOT NULL DEFAULT '0000-00-00',
birthDate date NULL,
sex enum('male','female','couple') NOT NULL DEFAULT 'female',
matchSex set('male','female','couple') NOT NULL DEFAULT 'male',
ip varchar(45) NOT NULL DEFAULT '127.0.0.1',
Expand Down Expand Up @@ -170,13 +170,13 @@ CREATE TABLE IF NOT EXISTS pH7_Affiliates (
password varchar(120) NOT NULL,
email varchar(120) NOT NULL,
sex enum('male','female') NOT NULL DEFAULT 'male',
birthDate date NOT NULL DEFAULT '0000-00-00',
birthDate date NULL,
ip varchar(45) NOT NULL DEFAULT '127.0.0.1',
bankAccount varchar(150) DEFAULT NULL,
amount decimal(8,2) NOT NULL DEFAULT '0.00',
totalPayment decimal(8,2) NOT NULL DEFAULT '0.00',
lastPayment decimal(8,2) NOT NULL DEFAULT '0.00',
lastPaymentDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
lastPaymentDate datetime NULL,
lang varchar(5) NOT NULL DEFAULT 'en_US',
hashValidation varchar(40) DEFAULT NULL,
isTwoFactorAuth enum('1','0') DEFAULT '0',
Expand Down Expand Up @@ -296,7 +296,7 @@ CREATE TABLE IF NOT EXISTS pH7_AlbumsPictures (
score float(9) unsigned DEFAULT '0',
views int(10) unsigned DEFAULT '0',
description varchar(255) DEFAULT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
PRIMARY KEY (albumId),
FOREIGN KEY (profileId) REFERENCES pH7_Members(profileId)
Expand All @@ -313,7 +313,7 @@ CREATE TABLE IF NOT EXISTS pH7_AlbumsVideos (
score float(9) unsigned DEFAULT '0',
views int(10) unsigned DEFAULT '0',
description varchar(255) DEFAULT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
PRIMARY KEY (albumId),
FOREIGN KEY (profileId) REFERENCES pH7_Members(profileId)
Expand All @@ -331,7 +331,7 @@ CREATE TABLE IF NOT EXISTS pH7_Pictures (
votes int(9) unsigned DEFAULT '0',
score float(9) unsigned DEFAULT '0',
views int(10) unsigned DEFAULT '0',
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
PRIMARY KEY (pictureId),
FOREIGN KEY (albumId) REFERENCES pH7_AlbumsPictures(albumId),
Expand All @@ -351,7 +351,7 @@ CREATE TABLE IF NOT EXISTS pH7_Videos (
votes int(9) unsigned DEFAULT '0',
score float(9) unsigned DEFAULT '0',
views int(10) unsigned DEFAULT '0',
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
duration int(9) NOT NULL,
PRIMARY KEY (videoId),
Expand Down Expand Up @@ -390,7 +390,7 @@ CREATE TABLE IF NOT EXISTS pH7_Blogs (
score float(9) unsigned DEFAULT '0',
views int(10) unsigned DEFAULT '0',
enableComment enum('1','0') DEFAULT '1',
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
PRIMARY KEY (blogId),
UNIQUE KEY postId (postId)
Expand Down Expand Up @@ -456,7 +456,7 @@ CREATE TABLE IF NOT EXISTS pH7_Notes (
score float(9) unsigned DEFAULT '0',
views int(10) unsigned DEFAULT '0',
enableComment enum('1','0') DEFAULT '1',
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (noteId),
Expand Down Expand Up @@ -511,7 +511,7 @@ CREATE TABLE IF NOT EXISTS pH7_CommentsBlog (
sender int(10) unsigned NOT NULL,
recipient mediumint(10) unsigned NOT NULL,
comment text NOT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved enum('1','0') NOT NULL DEFAULT '1',
PRIMARY KEY (commentId),
Expand All @@ -526,7 +526,7 @@ CREATE TABLE IF NOT EXISTS pH7_CommentsNote (
sender int(10) unsigned NOT NULL,
recipient int(10) unsigned NOT NULL,
comment text NOT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved enum('1','0') NOT NULL DEFAULT '1',
PRIMARY KEY (commentId),
Expand All @@ -541,7 +541,7 @@ CREATE TABLE IF NOT EXISTS pH7_CommentsPicture (
sender int(10) unsigned NOT NULL,
recipient int(10) unsigned NOT NULL,
comment text NOT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved enum('1','0') NOT NULL DEFAULT '1',
PRIMARY KEY (commentId),
Expand All @@ -556,7 +556,7 @@ CREATE TABLE IF NOT EXISTS pH7_CommentsVideo (
sender int(10) unsigned NOT NULL,
recipient int(10) unsigned NOT NULL,
comment text NOT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved enum('1','0') NOT NULL DEFAULT '1',
PRIMARY KEY (commentId),
Expand All @@ -571,7 +571,7 @@ CREATE TABLE IF NOT EXISTS pH7_CommentsGame (
sender int(10) unsigned NOT NULL,
recipient int(10) unsigned NOT NULL,
comment text NOT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved enum('1','0') NOT NULL DEFAULT '1',
PRIMARY KEY (commentId),
Expand All @@ -586,7 +586,7 @@ CREATE TABLE IF NOT EXISTS pH7_CommentsProfile (
sender int(10) unsigned NOT NULL,
recipient int(10) unsigned NOT NULL,
comment text NOT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
approved enum('1','0') DEFAULT '1',
PRIMARY KEY (commentId),
Expand Down Expand Up @@ -614,7 +614,7 @@ CREATE TABLE IF NOT EXISTS pH7_Forums (
name varchar(80) NOT NULL DEFAULT 'New forum',
description varchar(255) NOT NULL,
categoryId smallint(4) unsigned DEFAULT NULL,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
PRIMARY KEY (forumId),
FOREIGN KEY (categoryId) REFERENCES pH7_ForumsCategories(categoryId)
Expand All @@ -633,7 +633,7 @@ CREATE TABLE IF NOT EXISTS pH7_ForumsTopics (
title varchar(100) NOT NULL,
message text NOT NULL,
approved enum('1','0') DEFAULT '1',
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
views int(11) NOT NULL DEFAULT '0',
-- Maybe we'll let the topic of member even if the member is deleted
Expand All @@ -649,7 +649,7 @@ CREATE TABLE IF NOT EXISTS pH7_ForumsMessages (
profileId int(10) unsigned NOT NULL,
message text NOT NULL,
approved enum('1','0') DEFAULT '1',
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
-- Maybe we'll let the topic of member even if the member is deleted
-- FOREIGN KEY (profileId) pH7_Members(profileId),
Expand Down Expand Up @@ -835,7 +835,7 @@ CREATE TABLE IF NOT EXISTS pH7_MembersBackground (
CREATE TABLE IF NOT EXISTS pH7_MembersWhoViews (
profileId int(10) unsigned NOT NULL,
visitorId int(10) unsigned NOT NULL,
lastVisit datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
lastVisit datetime NULL,
INDEX profileId (profileId),
INDEX visitorId (visitorId),
FOREIGN KEY (profileId) REFERENCES pH7_Members(profileId),
Expand All @@ -859,7 +859,7 @@ CREATE TABLE IF NOT EXISTS pH7_MembersWall (
wallId int(10) unsigned NOT NULL AUTO_INCREMENT,
profileId int(10) unsigned NOT NULL DEFAULT '0',
post text CHARACTER SET armscii8,
createdDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
createdDate datetime NULL,
updatedDate datetime DEFAULT NULL,
PRIMARY KEY (wallId),
FOREIGN KEY (profileId) REFERENCES pH7_Members(profileId)
Expand All @@ -872,7 +872,7 @@ CREATE TABLE IF NOT EXISTS pH7_Messages (
recipient int(10) unsigned NOT NULL DEFAULT '0',
title varchar(30) NOT NULL DEFAULT '',
message text NOT NULL,
sendDate datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
sendDate datetime NULL,
status tinyint(1) unsigned NOT NULL DEFAULT '1',
trash set('sender','recipient') NOT NULL DEFAULT '',
toDelete set('sender','recipient') NOT NULL DEFAULT '',
Expand All @@ -888,7 +888,7 @@ CREATE TABLE IF NOT EXISTS pH7_Messenger (
fromUser varchar(40) NOT NULL DEFAULT '',
toUser varchar(40) NOT NULL DEFAULT '',
message text NOT NULL,
sent datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
sent datetime NULL,
recd int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (messengerId),
FOREIGN KEY (fromUser) REFERENCES pH7_Members(username),
Expand Down

0 comments on commit 4bb8aa7

Please sign in to comment.