mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-15 12:27:49 +00:00
feat: abstract database drivers
This commit is contained in:
9
store/db/sqlite/seed/10000__reset.sql
Normal file
9
store/db/sqlite/seed/10000__reset.sql
Normal file
@ -0,0 +1,9 @@
|
||||
DELETE FROM activity;
|
||||
|
||||
DELETE FROM shortcut;
|
||||
|
||||
DELETE FROM user_setting;
|
||||
|
||||
DELETE FROM user;
|
||||
|
||||
DELETE FROM workspace_setting;
|
34
store/db/sqlite/seed/10001__user.sql
Normal file
34
store/db/sqlite/seed/10001__user.sql
Normal file
@ -0,0 +1,34 @@
|
||||
INSERT INTO
|
||||
user (
|
||||
`id`,
|
||||
`role`,
|
||||
`email`,
|
||||
`nickname`,
|
||||
`password_hash`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
101,
|
||||
'ADMIN',
|
||||
'slash@yourselfhosted.com',
|
||||
'Slasher',
|
||||
'$2a$10$H8HBWGcG/hoePhFy5SiNKOHxMD6omIpyEEWbl/fIorFC814bXW.Ua'
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
user (
|
||||
`id`,
|
||||
`role`,
|
||||
`email`,
|
||||
`nickname`,
|
||||
`password_hash`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
102,
|
||||
'USER',
|
||||
'steven@yourselfhosted.com',
|
||||
'Steven',
|
||||
-- raw password: secret
|
||||
'$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK'
|
||||
);
|
94
store/db/sqlite/seed/10002__shortcut.sql
Normal file
94
store/db/sqlite/seed/10002__shortcut.sql
Normal file
@ -0,0 +1,94 @@
|
||||
INSERT INTO
|
||||
shortcut (
|
||||
`id`,
|
||||
`creator_id`,
|
||||
`name`,
|
||||
`link`,
|
||||
`visibility`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
1,
|
||||
101,
|
||||
'discord',
|
||||
'https://discord.gg/QZqUuUAhDV',
|
||||
'PUBLIC'
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
shortcut (
|
||||
`id`,
|
||||
`creator_id`,
|
||||
`name`,
|
||||
`link`,
|
||||
`visibility`,
|
||||
`tag`,
|
||||
`og_metadata`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
2,
|
||||
101,
|
||||
'ai-infra',
|
||||
'https://star-history.com/blog/open-source-ai-infra-projects',
|
||||
'PUBLIC',
|
||||
'star-history ai',
|
||||
'{"title":"Open Source AI Infra for Your Next Project","description":"Some open-source infra projects that can be directly used for your next project. 💡","image":"https://star-history.com/blog/assets/open-source-ai-infra-projects/banner.webp"}'
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
shortcut (
|
||||
`id`,
|
||||
`creator_id`,
|
||||
`name`,
|
||||
`link`,
|
||||
`visibility`,
|
||||
`tag`,
|
||||
`og_metadata`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
3,
|
||||
101,
|
||||
'schema-change',
|
||||
'https://www.bytebase.com/blog/how-to-handle-database-schema-change/#what-is-a-database-schema-change',
|
||||
'PUBLIC',
|
||||
'database article👍',
|
||||
'{"title":"How to Handle Database Migration / Schema Change?","description":"A database schema is the structure of a database, which describes the relationships between the different tables and fields in the database. A database schema change, also known as schema migration, or simply migration refers to any alteration to this structure, such as adding a new table, modifying the data type of a field, or changing the relationships between tables.","image":"https://www.bytebase.com/_next/image/?url=%2Fcontent%2Fblog%2Fhow-to-handle-database-schema-change%2Fchange.webp\u0026w=2048\u0026q=75"}'
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
shortcut (
|
||||
`id`,
|
||||
`creator_id`,
|
||||
`name`,
|
||||
`link`,
|
||||
`tag`,
|
||||
`visibility`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
4,
|
||||
101,
|
||||
'sqlchat',
|
||||
'https://www.sqlchat.ai',
|
||||
'ai chatbot sql',
|
||||
'WORKSPACE'
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
shortcut (
|
||||
`id`,
|
||||
`creator_id`,
|
||||
`name`,
|
||||
`link`,
|
||||
`visibility`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
5,
|
||||
102,
|
||||
'stevenlgtm',
|
||||
'https://github.com/boojack',
|
||||
'PUBLIC'
|
||||
);
|
20
store/db/sqlite/seed/10003__collection.sql
Normal file
20
store/db/sqlite/seed/10003__collection.sql
Normal file
@ -0,0 +1,20 @@
|
||||
INSERT INTO
|
||||
collection (
|
||||
`id`,
|
||||
`creator_id`,
|
||||
`name`,
|
||||
`title`,
|
||||
`description`,
|
||||
`visibility`,
|
||||
`shortcut_ids`
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
1,
|
||||
101,
|
||||
'minecraft',
|
||||
'Minecraft',
|
||||
'My daily thoughts and ideas',
|
||||
'PUBLIC',
|
||||
'1,2,3,4,5'
|
||||
);
|
Reference in New Issue
Block a user