-
Notifications
You must be signed in to change notification settings - Fork 0
/
netflex.sql
52 lines (48 loc) · 1.44 KB
/
netflex.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CREATE DATABASE IF NOT EXISTS netflex
COLLATE utf8mb4_unicode_ci;
USE netflex;
CREATE TABLE IF NOT EXISTS user
(
id BIGINT unsigned NOT NULL AUTO_INCREMENT,
firstname VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
nickname VARCHAR(255) UNIQUE,
email VARCHAR(255) UNIQUE,
password VARCHAR(255) NOT NULL,
create_at DATETIME NOT NULL DEFAULT current_timestamp,
image_url TEXT NOT NULL DEFAULT "https://cdn-icons-png.flaticon.com/512/5089/5089983.png",
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS films
(
id BIGINT unsigned NOT NULL AUTO_INCREMENT,
show_id VARCHAR(255) UNIQUE,
type VARCHAR(255) NOT NULL,
title VARCHAR(255) NOT NULL,
director VARCHAR(255),
cast text,
country VARCHAR(100) NOT NULL,
date_added DATETIME NOT NULL,
release_year VARCHAR(4) NOT NULL,
rating VARCHAR(5) NOT NULL,
duration VARCHAR(10) NOT NULL,
listed_in VARCHAR(100) NOT NULL,
description text NOT NULL,
picture text NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS logs
(
id BIGINT unsigned NOT NULL AUTO_INCREMENT,
user_email VARCHAR(255) NOT NULL,
connected_at DATETIME NOT NULL DEFAULT current_timestamp,
user_agent VARCHAR(255),
navigateur VARCHAR(255),
platform VARCHAR(255),
language VARCHAR(255),
encoding VARCHAR(255),
is_on_mobile BOOLEAN DEFAULT false,
ip_address VARCHAR(255),
country VARCHAR(255),
PRIMARY KEY (id)
);