Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Migrations
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
libraries
Migrations
Merge requests
!33
New: Add ApiToken Table
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
New: Add ApiToken Table
Topic/1125-apiTokens
into
Product/903-ApiTokens
Overview
0
Commits
6
Pipelines
2
Changes
7
Merged
L. Ellenbeck
requested to merge
Topic/1125-apiTokens
into
Product/903-ApiTokens
4 years ago
Overview
0
Commits
6
Pipelines
2
Changes
7
Expand
coscine/issues#1125
Edited
4 years ago
by
Benedikt Heinrichs
0
0
Merge request reports
Compare
Product/903-ApiTokens
version 1
2cba0fd4
4 years ago
Product/903-ApiTokens (base)
and
latest version
latest version
0282b54f
6 commits,
4 years ago
version 1
2cba0fd4
5 commits,
4 years ago
7 files
+
297
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
src/Migrations/Migrations/Migration202010271100ApiTokens.cs
0 → 100644
+
28
−
0
Options
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
(
"Name"
).
AsString
().
NotNullable
()
.
WithColumn
(
"UserId"
).
AsGuid
().
NotNullable
()
.
WithColumn
(
"IssuedAt"
).
AsDateTime
().
NotNullable
()
.
WithColumn
(
"Expiration"
).
AsDateTime
().
NotNullable
();
Create
.
ForeignKey
()
.
FromTable
(
"ApiTokens"
).
ForeignColumn
(
"UserId"
)
.
ToTable
(
"Users"
).
PrimaryColumn
(
"Id"
);
}
}
}
Loading