mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: support Postgres (#2569)
* skeleton of postgres skeleton * Adding Postgres specific db schema sql * user test passed * memo store test passed * tag is working * update user setting test done * activity test done * idp test passed * inbox test done * memo_organizer, UNTESTED * memo relation test passed * webhook test passed * system setting test passed * passed storage test * pass resource test * migration_history done * fix memo_relation_test * fixing server memo_relation test * passes memo relation server test * paess memo test * final manual testing done * final fixes * final fixes cleanup * sync schema * lint * lint * lint * lint * lint
This commit is contained in:
4
store/db/postgres/seed/10000__reset.sql
Normal file
4
store/db/postgres/seed/10000__reset.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
TRUNCATE TABLE memo_organizer;
|
||||
TRUNCATE TABLE resource;
|
||||
TRUNCATE TABLE memo;
|
||||
TRUNCATE TABLE user;
|
44
store/db/postgres/seed/10001__user.sql
Normal file
44
store/db/postgres/seed/10001__user.sql
Normal file
@@ -0,0 +1,44 @@
|
||||
INSERT INTO "user" (
|
||||
id,
|
||||
username,
|
||||
role,
|
||||
email,
|
||||
nickname,
|
||||
row_status,
|
||||
avatar_url,
|
||||
password_hash
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
101,
|
||||
'memos-demo',
|
||||
'HOST',
|
||||
'demo@usememos.com',
|
||||
'Derobot',
|
||||
'NORMAL',
|
||||
'',
|
||||
-- raw password: secret
|
||||
'$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK'
|
||||
),
|
||||
(
|
||||
102,
|
||||
'jack',
|
||||
'USER',
|
||||
'jack@usememos.com',
|
||||
'Jack',
|
||||
'NORMAL',
|
||||
'',
|
||||
-- raw password: secret
|
||||
'$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK'
|
||||
),
|
||||
(
|
||||
103,
|
||||
'bob',
|
||||
'USER',
|
||||
'bob@usememos.com',
|
||||
'Bob',
|
||||
'ARCHIVED',
|
||||
'',
|
||||
-- raw password: secret
|
||||
'$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK'
|
||||
);
|
34
store/db/postgres/seed/10002__memo.sql
Normal file
34
store/db/postgres/seed/10002__memo.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
INSERT INTO memo (id, content, creator_id)
|
||||
VALUES
|
||||
(
|
||||
1,
|
||||
'#Hello 👋 Welcome to memos.',
|
||||
101
|
||||
);
|
||||
|
||||
INSERT INTO memo (id, content, creator_id, visibility)
|
||||
VALUES
|
||||
(
|
||||
2,
|
||||
E'#TODO\n- [x] Take more photos about **🌄 sunset**\n- [x] Clean the room\n- [ ] Read *📖 The Little Prince*\n(👆 click to toggle status)',
|
||||
101,
|
||||
'PROTECTED'
|
||||
),
|
||||
(
|
||||
3,
|
||||
E'**[Slash](https://github.com/yourselfhosted/slash)**: A bookmarking and url shortener, save and share your links very easily.\n**[SQL Chat](https://www.sqlchat.ai)**: Chat-based SQL Client',
|
||||
101,
|
||||
'PUBLIC'
|
||||
),
|
||||
(
|
||||
4,
|
||||
E'#TODO\n- [x] Take more photos about **🌄 sunset**\n- [ ] Clean the classroom\n- [ ] Watch *👦 The Boys*\n(👆 click to toggle status)',
|
||||
102,
|
||||
'PROTECTED'
|
||||
),
|
||||
(
|
||||
5,
|
||||
'三人行,必有我师焉!👨🏫',
|
||||
102,
|
||||
'PUBLIC'
|
||||
);
|
5
store/db/postgres/seed/10003__memo_organizer.sql
Normal file
5
store/db/postgres/seed/10003__memo_organizer.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
INSERT INTO
|
||||
memo_organizer (memo_id, user_id, pinned)
|
||||
VALUES
|
||||
(1, 101, 1),
|
||||
(3, 101, 1);
|
6
store/db/postgres/seed/10004__tag.sql
Normal file
6
store/db/postgres/seed/10004__tag.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
INSERT INTO
|
||||
tag (name, creator_id)
|
||||
VALUES
|
||||
('Hello', 101),
|
||||
('TODO', 101),
|
||||
('TODO', 102);
|
Reference in New Issue
Block a user