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
!80
Issue/1995 new table gitlab resource type
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue/1995 new table gitlab resource type
Issue/1995-newTableGitlabResourceType
into
dev
Overview
0
Commits
5
Pipelines
6
Changes
4
Merged
Sandra Westerhoff
requested to merge
Issue/1995-newTableGitlabResourceType
into
dev
2 years ago
Overview
0
Commits
5
Pipelines
6
Changes
4
Expand
coscine/issues#1995
Edited
2 years ago
by
Sandra Westerhoff
0
0
Merge request reports
Compare
dev
version 4
7bc84551
2 years ago
version 3
62380ca8
2 years ago
version 2
11ad58a5
2 years ago
version 1
9e1932ea
2 years ago
dev (base)
and
latest version
latest version
bac978e2
5 commits,
2 years ago
version 4
7bc84551
4 commits,
2 years ago
version 3
62380ca8
3 commits,
2 years ago
version 2
11ad58a5
2 commits,
2 years ago
version 1
9e1932ea
1 commit,
2 years ago
4 files
+
83
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/Migrations/Migrations/Migration202207191035GitlabResourceType.cs
0 → 100644
+
51
−
0
Options
using
Coscine.Configuration
;
using
FluentMigrator
;
namespace
Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[
Migration
(
202207191035
)]
public
class
Migration202207191035GitlabResourceType
:
Migration
{
public
override
void
Down
()
{
Execute
.
EmbeddedScript
(
"Migration202207191035GitlabResourceType_down.sql"
);
Update
.
Table
(
"ResourceTypes"
)
.
Set
(
new
{
Type
=
"gitlab"
,
SpecificType
=
"gitlab"
})
.
Where
(
new
{
DisplayName
=
"gitlab"
});
// delete new table GitlabResourceType
Delete
.
Table
(
"GitlabResourceType"
);
// create it like it was before
Create
.
Table
(
"GitlabResourceType"
)
.
WithColumn
(
"Id"
).
AsGuid
().
PrimaryKey
().
WithDefault
(
SystemMethods
.
NewGuid
)
.
WithColumn
(
"RepositoryNumber"
).
AsInt32
().
NotNullable
()
.
WithColumn
(
"RepositoryUrl"
).
AsString
(
500
).
NotNullable
()
.
WithColumn
(
"Token"
).
AsString
(
100
).
NotNullable
();
}
public
override
void
Up
()
{
Update
.
Table
(
"ResourceTypes"
)
.
Set
(
new
{
Type
=
"gitlab"
,
SpecificType
=
"gitlabrwth"
})
.
Where
(
new
{
DisplayName
=
"gitlab"
});
// Add quotas and delete old gitlab entries from resources table
Execute
.
EmbeddedScript
(
"Migration202207191035GitlabResourceType_up.sql"
);
// delete table GitlabResourceType
Delete
.
Table
(
"GitlabResourceType"
);
// and create it new
Create
.
Table
(
"GitlabResourceType"
)
.
WithColumn
(
"Id"
).
AsGuid
().
PrimaryKey
().
WithDefault
(
SystemMethods
.
NewGuid
)
.
WithColumn
(
"Branch"
).
AsString
(
200
).
NotNullable
()
.
WithColumn
(
"GitlabProjectId"
).
AsInt32
().
NotNullable
()
.
WithColumn
(
"RepoUrl"
).
AsString
(
200
).
NotNullable
()
.
WithColumn
(
"ProjectAccessToken"
).
AsString
(
200
).
NotNullable
();
}
}
}
\ No newline at end of file
Loading