* refactor: move migrations to new structure * refactor: convert all findMany to new structure * fix(backups-schedule): missing null matching for last backup status * chore: move root lib to server
10 lines
328 B
SQL
10 lines
328 B
SQL
INSERT INTO member (id, organization_id, user_id, role, created_at)
|
|
SELECT
|
|
'default-mem-' || u.id as id,
|
|
'default-org-' || u.id as organization_id,
|
|
u.id as user_id,
|
|
'owner' as role,
|
|
strftime('%s', 'now') * 1000 as created_at
|
|
FROM users_table u
|
|
LEFT JOIN member m ON u.id = m.user_id
|
|
WHERE m.user_id IS NULL;
|