Skip to content

Commit

Permalink
chore: generate database fixtures
Browse files Browse the repository at this point in the history
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
  • Loading branch information
jdrouet committed Nov 11, 2022
1 parent b0cc5eb commit 3187b76
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 16 additions & 0 deletions migrations/20221111221000_fixtures.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
insert into account (login)
select 'account_'||idx
from generate_series(0, 1000000) idx;

insert into list (account_id, name)
select
account.id as account_id,
md5('list_'||account.id||'_'||idx) as name
from account join generate_series(0, 1000000) idx on true;

insert into task (list_id, name, description)
select
list.id as list_id,
md5('list_'||list.id||'_'||idx||'_name') as name,
md5('list_'||list.id||'_'||idx||'_description') as description
from list join generate_series(0, 1000000) idx on true;
1 change: 0 additions & 1 deletion migrations/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
FROM postgres:14.2-bullseye

COPY *.sql /docker-entrypoint-initdb.d/

0 comments on commit 3187b76

Please sign in to comment.