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
33e751f0
Commit
33e751f0
authored
Oct 27, 2020
by
L. Ellenbeck
Browse files
Update: added api token migration coscine/issues#1125
parent
53fff78e
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Migrations/Migrations.csproj
View file @
33e751f0
...
...
@@ -205,6 +205,7 @@
<Compile
Include=
"Migrations\Migration202005281400ProjectUrl.cs"
/>
<Compile
Include=
"Migrations\Migration202006261208ProjectQuotas.cs"
/>
<Compile
Include=
"CoscineMigrations.cs"
/>
<Compile
Include=
"Migrations\Migration202010271100ApiTokens.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<ItemGroup>
...
...
src/Migrations/Migrations/Migration202010271100ApiTokens.cs
0 → 100644
View file @
33e751f0
using
FluentMigrator
;
namespace
Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[
Migration
(
202010271100
)]
public
class
Migration202010271100ApiTokens
:
Migration
{
public
override
void
Down
()
{
Delete
.
Table
(
"ApiTokens"
);
}
public
override
void
Up
()
{
Create
.
Table
(
"ApiTokens"
)
.
WithColumn
(
"Id"
).
AsGuid
().
PrimaryKey
().
WithDefault
(
SystemMethods
.
NewGuid
)
.
WithColumn
(
"UserId"
).
AsGuid
().
NotNullable
()
.
WithColumn
(
"Creation"
).
AsDateTime
().
NotNullable
()
.
WithColumn
(
"Expiration"
).
AsDateTime
().
NotNullable
();
Create
.
ForeignKey
()
.
FromTable
(
"ApiTokens"
).
ForeignColumn
(
"UserId"
)
.
ToTable
(
"Users"
).
PrimaryColumn
(
"Id"
);
}
}
}
Write
Preview
Supports
Markdown
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