Projet

Général

Profil

US #258 » SCORE_SQL_V3 Practice.sql

Tarek AOUADI, 27/07/2023 17:23

 
1
use score ;
2

    
3
CREATE TABLE practices
4
	id int NOT NULL AUTO_INCREMENT, 
5
	practicesgroup varchar(255) NOT NULL, 
6
	title text NOT NULL, 
7
	duration varchar(255) NOT NULL, 
8
	views int NOT NULL, 
9
	likes int NOT NULL, 
10
	createdAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), 
11
	shortDescription text NOT NULL, longDescription text NOT NULL, 
12
	status enum('save', 'publish') NOT NULL DEFAULT 'save', 
13
	language enum('FR', 'EN', 'ES', 'LT') NOT NULL DEFAULT 'EN') ;
14

    
15
CREATE TABLE practices_Domains
16
	practices_id int NOT NULL, 
17
	domain_id int NOT NULL, INDEX IDX_xxxxxxxxxxxxxxxxxxxxxxx(buildingBlocks_id), INDEX IDX_xxxxxxxxxxxxxxxxxxxxxxx(domain_id), 
18
	PRIMARY KEY(buildingBlocks_id, domain_id)); 
19

    
20

    
21
CREATE TABLE practices_Hashtags
22
	practices_id int NOT NULL, 
23
	hashtags_id int NOT NULL, INDEX IDX_xxxxxxxxxxxxxxxxxxxxxxx(buildingBlocks_id), INDEX IDX_xxxxxxxxxxxxxxxxxxxxxxx(hashtags_id), 
24
	PRIMARY KEY(buildingBlocks_id, hashtags_id)); 
25

    
26

    
27
CREATE TABLE practices_Steps
28
	practices_id int NOT NULL,
29
	step enum('Set-up', 'Raise awareness', 'Explore practice and sytems', 'Make and prototype', 'Reflet', 'Share') NOT NULL DEFAULT 'Set-up')
30
	buildingBlockId int NOT NULL,
31
	order int NOT NULL,
32
	
33

    
(1-1/2)