brief-06-back/maria.sql
Mathis 1ad136ea60
feat: Implement registration feature and update database service
This commit creates new methods for the authentication system, especially the user registration feature. The update also validates input data and checks if a user already exists in the database. It modifies the application entry point to include the updated user registration route and provides updates to the database service to include user-related functions. The MariaDB collation was also updated in the database schema script to support unicode.
2024-05-21 16:14:54 +02:00

34 lines
1.9 KiB
SQL

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' collate = utf8mb4_unicode_ci;
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;