Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the genre to the album table for the sqlite example #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion setup/vendor/sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
FOREIGN KEY ("artist_id") REFERENCES "artist" ("id"),
FOREIGN KEY ("genre_id") REFERENCES "genre" ("id")
);',
'CREATE TABLE IF NOT EXISTS "album_genre" (
"album_id" int(11) NOT NULL,
"genre_id" int(11) NOT NULL,
"added_on" date NOT NULL,
PRIMARY KEY ("album_id","genre_id"),
FOREIGN KEY ("album_id") REFERENCES "album" ("id"),
FOREIGN KEY ("genre_id") REFERENCES "genre" ("id")
);',
'CREATE TABLE IF NOT EXISTS "track" (
"id" INTEGER PRIMARY KEY,
"artist_id" int(11) DEFAULT NULL,
Expand All @@ -47,13 +55,15 @@
'DROP TABLE IF EXISTS "artist"',
'DROP TABLE IF EXISTS "genre"',
'DROP TABLE IF EXISTS "artist_genre"',
'DROP TABLE IF EXISTS "album_genre"',
'DROP TABLE IF EXISTS "track"'
),
'data_down' => array(
'DELETE FROM "album"',
'DELETE FROM "artist"',
'DELETE FROM "artist_genre"',
'DELETE FROM "album_genre"',
'DELETE FROM "genre"',
'DELETE FROM "track"',
)
));
));