-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathschema.sql
More file actions
73 lines (61 loc) · 1.69 KB
/
schema.sql
File metadata and controls
73 lines (61 loc) · 1.69 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* AssistList
* @author evilnapsis
* Updated 2026-03-20
**/
create database assistlist;
use assistlist;
create table kind(
id int not null auto_increment primary key,
name varchar(50) not null
);
insert into kind (name) value ("Administrador");
insert into kind (name) value ("Usuario");
create table user(
id int not null auto_increment primary key,
bio text,
image varchar(255),
name varchar(50) not null,
lastname varchar(50) not null,
username varchar(50),
email varchar(255) not null,
password varchar(60) not null,
phone varchar(255),
address varchar(255),
code varchar(20),
status boolean not null default 0,
kind boolean not null default 0,
created_at datetime not null
);
insert into user(email,password,status,kind,created_at) value ("admin","90b9aa7e25f80cf4f64e990b78a9fc5ebd6cecad",1,1,NOW());
create table person(
id int not null auto_increment primary key,
image varchar(50) not null,
name varchar(50) not null,
lastname varchar(50) not null,
email varchar(255) not null,
address varchar(60) not null,
phone varchar(60) not null,
c1_fullname varchar(100),
c1_address varchar(100),
c1_phone varchar(100),
c1_note varchar(100),
c2_fullname varchar(100),
c2_address varchar(100),
c2_phone varchar(100),
c2_note varchar(100),
is_active boolean not null default 1,
created_at datetime,
user_id int not null,
foreign key (user_id) references user(id)
);
/* 1.- Asistencia, 2.- Falta, 3.- Retardo, 4.- Justificacion */
create table assistance(
id int not null auto_increment primary key,
kind_id int,
date_at date not null,
person_id int not null,
user_id int not null,
foreign key (user_id) references user(id),
foreign key (person_id) references person(id)
);