Skip to content

Commit aa7b8f5

Browse files
committed
WIP MySQL
1 parent 1a1fcdd commit aa7b8f5

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# multi-tenant-sql
22

3-
SQL starters for building multi tenant applications with MySQL, PostgreSQL and SQLite.
3+
SQL starters for building multi tenant applications with MySQL, PostgreSQL and SQLite. The
44

55
## How to use this
66

mysql.sql

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CREATE TABLE IF NOT EXISTS `organization` (
2+
`id` bigint NOT NULL AUTO_INCREMENT,
3+
`name` VARCHAR(255) NOT NULL,
4+
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
5+
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
6+
PRIMARY KEY (`id`)
7+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
8+
9+
CREATE TABLE IF NOT EXISTS `membership` (
10+
`id` BIGINT NOT NULL AUTO_INCREMENT,
11+
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
12+
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
13+
PRIMARY KEY (`id`)
14+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
15+
16+
CREATE TABLE IF NOT EXISTS `user` (
17+
`id` BIGINT NOT NULL AUTO_INCREMENT,
18+
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
19+
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
20+
PRIMARY KEY (`id`)
21+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

postgresql.sql

Whitespace-only changes.

sqlite.sql

Whitespace-only changes.

0 commit comments

Comments
 (0)