markdown Sequelize_Mysql_Relation

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Sequelize_Mysql_Relation相关的知识,希望对你有一定的参考价值。

### Database name : node_sequelize

```
CREATE DATABASE node_sequelize;
```

### Don't need to create the tables tables will be created by sequelize

### tables:

        1: users



        2: movies

### Run the App so sequelize create the table for us.

## Now Add foreign key on to movies

### Add foreign column u_id

```
ALTER TABLE movies ADD u_id INT NOT NULL ;

```

### Now Add foreign relation between tables

```
ALTER TABLE movies ADD FOREIGN KEY (u_id) REFERENCES users(id);
```

以上是关于markdown Sequelize_Mysql_Relation的主要内容,如果未能解决你的问题,请参考以下文章

markdown预览前端实现是用正则匹配么

Markdown用法解析

MarkDown

Markdown 笔记

Markdown 基本入门使用

markdown 原型和__proto__