Skip to content

Commit

Permalink
add lables table
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed May 9, 2024
1 parent 78e18e8 commit b3c56f4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ func runTables(db *sql.DB) {
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)`

tables["labels"] = `CREATE TABLE IF NOT EXISTS labels (
id INT NOT NULL AUTO_INCREMENT UNIQUE,
title VARCHAR(255) NOT NULL,
user_id INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id)
)`

for _, table := range tables {
db.Exec(table)
}
Expand Down

0 comments on commit b3c56f4

Please sign in to comment.