diff --git a/schema/mssql/query_menu_items.sql b/schema/mssql/query_menu_items.sql index ca6ca556..98195038 100644 --- a/schema/mssql/query_menu_items.sql +++ b/schema/mssql/query_menu_items.sql @@ -1,7 +1,7 @@ CREATE TABLE [menu_items] ( [miid] int not null IDENTITY, [mid] int not null, - [name] nvarchar (200) not null, + [name] nvarchar (200) DEFAULT '' not null, [htmlID] nvarchar (200) DEFAULT '' not null, [cssClass] nvarchar (200) DEFAULT '' not null, [position] nvarchar (100) not null, diff --git a/schema/mssql/query_users_replies.sql b/schema/mssql/query_users_replies.sql index ced6bea6..3ded1423 100644 --- a/schema/mssql/query_users_replies.sql +++ b/schema/mssql/query_users_replies.sql @@ -5,8 +5,8 @@ CREATE TABLE [users_replies] ( [parsed_content] nvarchar (MAX) not null, [createdAt] datetime not null, [createdBy] int not null, - [lastEdit] int not null, - [lastEditBy] int not null, + [lastEdit] int DEFAULT 0 not null, + [lastEditBy] int DEFAULT 0 not null, [ipaddress] nvarchar (200) DEFAULT '0.0.0.0.0' not null, primary key([rid]) ); \ No newline at end of file diff --git a/schema/mysql/query_likes.sql b/schema/mysql/query_likes.sql index aa070390..2168e2a3 100644 --- a/schema/mysql/query_likes.sql +++ b/schema/mysql/query_likes.sql @@ -3,6 +3,6 @@ CREATE TABLE `likes` ( `targetItem` int not null, `targetType` varchar(50) DEFAULT 'replies' not null, `sentBy` int not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, `recalc` tinyint DEFAULT 0 not null ); \ No newline at end of file diff --git a/schema/mysql/query_menu_items.sql b/schema/mysql/query_menu_items.sql index 9cc3c620..2a0c90f7 100644 --- a/schema/mysql/query_menu_items.sql +++ b/schema/mysql/query_menu_items.sql @@ -1,7 +1,7 @@ CREATE TABLE `menu_items` ( `miid` int not null AUTO_INCREMENT, `mid` int not null, - `name` varchar(200) not null, + `name` varchar(200) DEFAULT '' not null, `htmlID` varchar(200) DEFAULT '' not null, `cssClass` varchar(200) DEFAULT '' not null, `position` varchar(100) not null, diff --git a/schema/mysql/query_polls_votes.sql b/schema/mysql/query_polls_votes.sql index 364940af..b706a4ae 100644 --- a/schema/mysql/query_polls_votes.sql +++ b/schema/mysql/query_polls_votes.sql @@ -2,6 +2,6 @@ CREATE TABLE `polls_votes` ( `pollID` int not null, `uid` int not null, `option` int DEFAULT 0 not null, - `castAt` datetime not null, + `castAt` datetime DEFAULT UTC_TIMESTAMP() not null, `ipaddress` varchar(200) DEFAULT '0.0.0.0.0' not null ) CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; \ No newline at end of file diff --git a/schema/mysql/query_registration_logs.sql b/schema/mysql/query_registration_logs.sql index 4ff25633..42713456 100644 --- a/schema/mysql/query_registration_logs.sql +++ b/schema/mysql/query_registration_logs.sql @@ -5,6 +5,6 @@ CREATE TABLE `registration_logs` ( `failureReason` varchar(100) not null, `success` bool DEFAULT 0 not null, `ipaddress` varchar(200) not null, - `doneAt` datetime not null, + `doneAt` datetime DEFAULT UTC_TIMESTAMP() not null, primary key(`rlid`) ); \ No newline at end of file diff --git a/schema/mysql/query_replies.sql b/schema/mysql/query_replies.sql index 636b46d5..d5becf6e 100644 --- a/schema/mysql/query_replies.sql +++ b/schema/mysql/query_replies.sql @@ -3,7 +3,7 @@ CREATE TABLE `replies` ( `tid` int not null, `content` text not null, `parsed_content` text not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, `createdBy` int not null, `lastEdit` int DEFAULT 0 not null, `lastEditBy` int DEFAULT 0 not null, diff --git a/schema/mysql/query_revisions.sql b/schema/mysql/query_revisions.sql index c74c994f..c0c21573 100644 --- a/schema/mysql/query_revisions.sql +++ b/schema/mysql/query_revisions.sql @@ -3,6 +3,6 @@ CREATE TABLE `revisions` ( `content` text not null, `contentID` int not null, `contentType` varchar(100) DEFAULT 'replies' not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, primary key(`reviseID`) ) CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; \ No newline at end of file diff --git a/schema/mysql/query_topics.sql b/schema/mysql/query_topics.sql index 10f2a89d..9ab59825 100644 --- a/schema/mysql/query_topics.sql +++ b/schema/mysql/query_topics.sql @@ -3,7 +3,7 @@ CREATE TABLE `topics` ( `title` varchar(100) not null, `content` text not null, `parsed_content` text not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, `lastReplyAt` datetime not null, `lastReplyBy` int not null, `createdBy` int not null, diff --git a/schema/mysql/query_users.sql b/schema/mysql/query_users.sql index 7425f95a..26fc659f 100644 --- a/schema/mysql/query_users.sql +++ b/schema/mysql/query_users.sql @@ -6,7 +6,7 @@ CREATE TABLE `users` ( `group` int not null, `active` boolean DEFAULT 0 not null, `is_super_admin` boolean DEFAULT 0 not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, `lastActiveAt` datetime not null, `session` varchar(200) DEFAULT '' not null, `last_ip` varchar(200) DEFAULT '0.0.0.0.0' not null, diff --git a/schema/mysql/query_users_2fa_keys.sql b/schema/mysql/query_users_2fa_keys.sql index 1cfd8a6f..69874119 100644 --- a/schema/mysql/query_users_2fa_keys.sql +++ b/schema/mysql/query_users_2fa_keys.sql @@ -9,6 +9,6 @@ CREATE TABLE `users_2fa_keys` ( `scratch6` varchar(50) not null, `scratch7` varchar(50) not null, `scratch8` varchar(50) not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, primary key(`uid`) ) CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; \ No newline at end of file diff --git a/schema/mysql/query_users_groups_scheduler.sql b/schema/mysql/query_users_groups_scheduler.sql index 255c8621..b9b547e3 100644 --- a/schema/mysql/query_users_groups_scheduler.sql +++ b/schema/mysql/query_users_groups_scheduler.sql @@ -2,7 +2,7 @@ CREATE TABLE `users_groups_scheduler` ( `uid` int not null, `set_group` int not null, `issued_by` int not null, - `issued_at` datetime not null, + `issued_at` datetime DEFAULT UTC_TIMESTAMP() not null, `revert_at` datetime not null, `temporary` boolean not null, primary key(`uid`) diff --git a/schema/mysql/query_users_replies.sql b/schema/mysql/query_users_replies.sql index b25499de..6a871bb0 100644 --- a/schema/mysql/query_users_replies.sql +++ b/schema/mysql/query_users_replies.sql @@ -3,10 +3,10 @@ CREATE TABLE `users_replies` ( `uid` int not null, `content` text not null, `parsed_content` text not null, - `createdAt` datetime not null, + `createdAt` datetime DEFAULT UTC_TIMESTAMP() not null, `createdBy` int not null, - `lastEdit` int not null, - `lastEditBy` int not null, + `lastEdit` int DEFAULT 0 not null, + `lastEditBy` int DEFAULT 0 not null, `ipaddress` varchar(200) DEFAULT '0.0.0.0.0' not null, primary key(`rid`) ) CHARSET=utf8mb4 COLLATE utf8mb4_general_ci; \ No newline at end of file diff --git a/schema/pgsql/query_menu_items.sql b/schema/pgsql/query_menu_items.sql index 0b8c260d..b3785263 100644 --- a/schema/pgsql/query_menu_items.sql +++ b/schema/pgsql/query_menu_items.sql @@ -1,7 +1,7 @@ CREATE TABLE "menu_items" ( `miid` serial not null, `mid` int not null, - `name` varchar (200) not null, + `name` varchar (200) DEFAULT '' not null, `htmlID` varchar (200) DEFAULT '' not null, `cssClass` varchar (200) DEFAULT '' not null, `position` varchar (100) not null, diff --git a/schema/pgsql/query_users_replies.sql b/schema/pgsql/query_users_replies.sql index 9c4abdc0..eefa2350 100644 --- a/schema/pgsql/query_users_replies.sql +++ b/schema/pgsql/query_users_replies.sql @@ -5,8 +5,8 @@ CREATE TABLE "users_replies" ( `parsed_content` text not null, `createdAt` timestamp not null, `createdBy` int not null, - `lastEdit` int not null, - `lastEditBy` int not null, + `lastEdit` int DEFAULT 0 not null, + `lastEditBy` int DEFAULT 0 not null, `ipaddress` varchar (200) DEFAULT '0.0.0.0.0' not null, primary key(`rid`) ); \ No newline at end of file