-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: initially add seed and migration files * feat: place seeds and migrations in folders * feat: remove not used inserts * fix: fix adoption code test * fix: remove init mariadb script from gh ci * feat: add node env check * fix: use migration both in tests and in docker compose * refactor: use sql connection as object * feat: separate dev and test dbs * fix: rename migration script * fix: fix docker compose file
- Loading branch information
1 parent
25500be
commit 0363f42
Showing
12 changed files
with
81 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE DATABASE IF NOT EXISTS directus; | ||
GRANT ALL PRIVILEGES ON directus.* to 'directus'@'%'; | ||
|
||
CREATE DATABASE IF NOT EXISTS `directus-test`; | ||
GRANT ALL PRIVILEGES ON `directus-test`.* to 'directus'@'%'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import fs from 'node:fs'; | ||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
|
||
export const up = async (db) => { | ||
const __filename = fileURLToPath(import.meta.url); | ||
const query = fs.readFileSync(path.join(__filename + '.sql'), 'utf8'); | ||
await db.schema.raw(query); | ||
}; | ||
|
||
export const down = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const seed = async (db) => { | ||
await db('directus_users').insert({ | ||
id: '89da69bd-a236-4ab7-9c5d-b5f52ce09959', | ||
github: 'jimaek', | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters