Skip to content

Commit

Permalink
Add beatmap packs table
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekuruu committed Oct 28, 2024
1 parent 9e32baa commit ac48f5e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions migrations/014_BeatmapPacks.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DELETE FROM beatmap_pack_entries;
DELETE FROM beatmap_packs;

DROP TABLE beatmap_pack_entries;
DROP TABLE beatmap_packs;
16 changes: 16 additions & 0 deletions migrations/014_BeatmapPacks.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
CREATE TABLE beatmap_packs (
id serial PRIMARY KEY,
name character varying(255) NOT NULL,
category character varying(255) NOT NULL,
description text NOT NULL DEFAULT '',
creator_id int NOT NULL REFERENCES users(id),
created_at timestamp without timezone NOT NULL DEFAULT now(),
updated_at timestamp without timezone NOT NULL DEFAULT now()
);

CREATE TABLE beatmap_pack_entries (
pack_id int NOT NULL REFERENCES beatmap_packs(id),
beatmap_id int NOT NULL REFERENCES beatmaps(id),
created_at timestamp without timezone NOT NULL DEFAULT now(),
PRIMARY KEY (pack_id, beatmap_id)
);

0 comments on commit ac48f5e

Please sign in to comment.