Skip to content

Commit

Permalink
[feat] 物品管理周りのsql作成
Browse files Browse the repository at this point in the history
  • Loading branch information
hikahana committed Dec 3, 2024
1 parent af2fc1a commit 8e0a627
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mysql/db/buy_reports.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
USE finansu_db;

CREATE TABLE buy_reports (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
festival_item_id INT(10) UNSIGNED NOT NULL,
amount INT(10) NOT NULL,
memo VARCHAR(255) NOT NULL,
paid_by VARCHAR(255) NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
10 changes: 10 additions & 0 deletions mysql/db/divisions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
USE finansu_db;

CREATE TABLE divisions (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
financial_record_id INT(10) UNSIGNED NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
11 changes: 11 additions & 0 deletions mysql/db/festival_items.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
USE finansu_db;

CREATE TABLE festival_items (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
memo VARCHAR(255) NOT NULL,
division_id INT(10) UNSIGNED NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
10 changes: 10 additions & 0 deletions mysql/db/item_budget.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
USE finansu_db;

CREATE TABLE item_budgets (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
amount INT(10) NOT NULL,
festival_item_id INT(10) UNSIGNED NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
10 changes: 10 additions & 0 deletions mysql/db/user_groups.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
USE finansu_db;

CREATE TABLE user_groups (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
user_id INT(10) NOT NULL,
group_id INT(10) NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id),
);

0 comments on commit 8e0a627

Please sign in to comment.