mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| minister |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> use minister;
Database changed
mysql> show tables;
+--------------------+
| Tables_in_minister |
+--------------------+
| tweets |
| users |
| users_follow_list |
+--------------------+
3 rows in set (0.00 sec)
mysql> explain users;
+-----------------+---------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+-------------------+-----------------------------+
| id | int | NO | PRI | NULL | auto_increment |
| name | varchar(255) | NO | | NULL | |
| email | varchar(255) | NO | UNI | NULL | |
| hashed_password | varchar(255) | NO | | NULL | |
| profile | varchar(2000) | NO | | NULL | |
| created_at | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED |
| updated_at | timestamp | YES | | NULL | on update CURRENT_TIMESTAMP |
+-----------------+---------------+------+-----+-------------------+-----------------------------+
7 rows in set (0.00 sec)
mysql> explain users_follow_list;
+----------------+-----------+------+-----+-------------------+-------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-----------+------+-----+-------------------+-------------------+
| user_id | int | NO | PRI | NULL | |
| follow_user_id | int | NO | PRI | NULL | |
| created_at | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED |
+----------------+-----------+------+-----+-------------------+-------------------+
3 rows in set (0.00 sec)
mysql> explain tweets;
+------------+--------------+------+-----+-------------------+-------------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------------+------+-----+-------------------+-------------------+
| id | int | NO | PRI | NULL | auto_increment |
| user_id | int | NO | MUL | NULL | |
| tweet | varchar(300) | NO | | NULL | |
| created_at | timestamp | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED |
+------------+--------------+------+-----+-------------------+-------------------+
4 rows in set (0.00 sec)
mysql>
반응형
'SW ENGINEERING > Flask' 카테고리의 다른 글
XSS (0) | 2021.02.25 |
---|---|
보안 점검 SQL Injection (0) | 2021.02.24 |
API 개발하기(15) - REFACTORING (0) | 2021.02.21 |
API 개발하기(14) - timeline 엔드포인트 (0) | 2021.02.21 |
API 개발하기(13) - tweet 엔드포인트 (0) | 2021.02.21 |
최근댓글