Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Trevor Austin
/
mpcs-52553-austin-winter-2021
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4fe42651
authored
Mar 03, 2021
by
Trevor Austin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add create combined table migration
parent
d39f4929
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
week_8/examples/posts_and_comments/20210303T143000-create_combines_table.sql
week_8/examples/posts_and_comments/20210303T143000-create_combines_table.sql
0 → 100644
View file @
4fe42651
-- create table posts (
-- id INT AUTO_INCREMENT PRIMARY KEY,
-- slug VARCHAR(30) NOT NULL,
-- title VARCHAR(255) NOT NULL,
-- body TEXT
-- );
--
-- create table comments (
-- id INT AUTO_INCREMENT PRIMARY KEY,
-- post_id INT,
-- body TEXT,
-- author VARCHAR(30),
-- FOREIGN KEY(post_id) REFERENCES posts(id)
-- );
create
table
posts_and_comments
(
id
INT
AUTO_INCREMENT
PRIMARY
KEY
,
body
TEXT
,
slug
VARCHAR
(
30
)
NOT
NULL
,
title
VARCHAR
(
255
)
NOT
NULL
,
post_id
INT
,
author
VARCHAR
(
30
)
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment