Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
libraries
Migrations
Commits
943f3a19
Commit
943f3a19
authored
May 06, 2021
by
Marcel Nellesen
Browse files
Merge branch 'Product/202-userInvitation' into 'Sprint/2021-08'
Product/202 user invitation See merge request
!59
parents
dd288e00
d5a81104
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Migrations/Migrations/Migration202104281216InvitationTabel.cs
0 → 100644
View file @
943f3a19
using
FluentMigrator
;
namespace
Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[
Migration
(
202104281216
)]
public
class
Migration202104281216InvitationTabel
:
FluentMigrator
.
Migration
{
public
override
void
Down
()
{
Delete
.
Table
(
"Invitations"
);
}
public
override
void
Up
()
{
Create
.
Table
(
"Invitations"
)
.
WithColumn
(
"Id"
).
AsGuid
().
NotNullable
().
PrimaryKey
().
WithDefault
(
SystemMethods
.
NewGuid
)
.
WithColumn
(
"Project"
).
AsGuid
().
NotNullable
()
.
WithColumn
(
"Issuer"
).
AsGuid
().
NotNullable
()
.
WithColumn
(
"Role"
).
AsGuid
().
NotNullable
()
.
WithColumn
(
"InviteeEmail"
).
AsString
(
200
).
NotNullable
()
.
WithColumn
(
"Expiration"
).
AsDateTime
().
NotNullable
()
.
WithColumn
(
"Token"
).
AsGuid
().
NotNullable
().
WithDefault
(
SystemMethods
.
NewGuid
);
Create
.
ForeignKey
()
.
FromTable
(
"Invitations"
).
ForeignColumn
(
"Project"
)
.
ToTable
(
"Projects"
).
PrimaryColumn
(
"Id"
);
Create
.
ForeignKey
()
.
FromTable
(
"Invitations"
).
ForeignColumn
(
"Issuer"
)
.
ToTable
(
"Users"
).
PrimaryColumn
(
"Id"
);
Create
.
ForeignKey
()
.
FromTable
(
"Invitations"
).
ForeignColumn
(
"Role"
)
.
ToTable
(
"Roles"
).
PrimaryColumn
(
"Id"
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment