From b3e319a2594371d3f418cbcb54f63bf542f28a8e Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 14 May 2024 23:35:31 +0200 Subject: [PATCH] feat: Add users and follows tables in maria.sql Added two new tables, 'users' and 'follows', to the maria.sql file. These tables are designed to store user information and follow relationships between users respectively. --- maria.sql | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 maria.sql diff --git a/maria.sql b/maria.sql new file mode 100644 index 0000000..31a1058 --- /dev/null +++ b/maria.sql @@ -0,0 +1,33 @@ +create table follows +( + id varchar(36) not null comment 'identifier of a follow' + primary key, + source_id varchar(36) not null comment 'identifier of the follower user', + target_id varchar(36) not null comment 'identifier of the followed user', + iat timestamp default current_timestamp() not null comment 'timestamp of the follow action' +) + comment 'follows of users'; + +create table users +( + id varchar(36) not null comment 'unique identifier of a user' + primary key, + username varchar(14) not null comment 'username of a user', + display_name varchar(16) not null comment 'displayName of a user', + email varchar(32) not null comment 'email of a user', + iat timestamp default current_timestamp() not null comment 'timestamp of when the account was created', + uat timestamp default current_timestamp() not null comment 'timestamp of the last update of the account information', + deactivated bit default b'0' not null comment 'does te account is deactivated', + hash varchar(97) not null comment 'hash of the password', + email_activation int(6) null comment 'email activation code', + admin bit default b'0' not null comment 'state for administration permission', + avatar_id varchar(16) null comment 'stored avatar identifier of a user', + gdpr timestamp default current_timestamp() null, + constraint users_email_pk + unique (email), + constraint users_username_pk + unique (username) +) + comment 'Table of the users' collate = utf8mb4_unicode_ci; + +