Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fahrtenbuch
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWP WS21_22 - Fahrtenbuch
Team Einhorn
fahrtenbuch
Commits
06ad39c2
Commit
06ad39c2
authored
3 years ago
by
alrwasheda
Browse files
Options
Downloads
Patches
Plain Diff
seeder only for testing purposes
parent
89418175
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/src/db/seeder.ts
+38
-0
38 additions, 0 deletions
server/src/db/seeder.ts
with
38 additions
and
0 deletions
server/src/db/seeder.ts
0 → 100644
+
38
−
0
View file @
06ad39c2
import
Boat
from
"
./models/Boat
"
;
const
seedBoatTable
=
async
()
=>
{
if
((
await
Boat
.
count
())
<
1
)
{
await
Boat
.
create
({
id
:
1
,
name
:
"
boat one
"
,
status
:
false
,
active
:
true
,
seats
:
5
,
});
await
Boat
.
create
({
id
:
2
,
name
:
"
boat two
"
,
status
:
false
,
active
:
true
,
seats
:
4
,
});
await
Boat
.
create
({
id
:
3
,
name
:
"
boat three
"
,
status
:
false
,
active
:
false
,
seats
:
2
,
});
}
};
const
seedCheckInTable
=
async
()
=>
{};
const
seedCustomerTable
=
async
()
=>
{};
const
runSeeders
=
async
()
=>
{
await
seedBoatTable
();
await
seedCheckInTable
();
await
seedCustomerTable
();
};
export
default
runSeeders
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment