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
fd77633c
Commit
fd77633c
authored
3 years ago
by
alrwasheda
Browse files
Options
Downloads
Patches
Plain Diff
boatType Model
parent
e9a58957
No related branches found
Branches containing commit
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/models/BoatType.ts
+45
-0
45 additions, 0 deletions
server/src/db/models/BoatType.ts
with
45 additions
and
0 deletions
server/src/db/models/BoatType.ts
0 → 100644
+
45
−
0
View file @
fd77633c
import
{
Sequelize
,
DataTypes
,
Model
,
Optional
}
from
"
sequelize
"
;
interface
BoatTypeAttributes
{
id
:
string
;
name
:
string
;
seats
:
number
;
}
export
interface
BoatTypeInput
extends
Optional
<
BoatTypeAttributes
,
"
id
"
>
{}
class
BoatType
extends
Model
<
BoatTypeAttributes
,
BoatTypeInput
>
implements
BoatTypeAttributes
{
declare
id
:
string
;
declare
name
:
string
;
declare
seats
:
number
;
declare
readonly
createdAt
:
Date
;
declare
readonly
updatedAt
:
Date
;
}
export
const
initBoatType
=
async
(
sequelizeConnection
:
Sequelize
)
=>
{
BoatType
.
init
(
{
id
:
{
type
:
DataTypes
.
UUID
,
defaultValue
:
DataTypes
.
UUIDV4
,
primaryKey
:
true
,
allowNull
:
false
,
},
name
:
{
type
:
new
DataTypes
.
STRING
(),
allowNull
:
false
,
},
seats
:
{
type
:
new
DataTypes
.
INTEGER
(),
allowNull
:
false
,
},
},
{
tableName
:
"
boatType
"
,
sequelize
:
sequelizeConnection
,
}
);
};
export
default
BoatType
;
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