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
!68
Hotfix/64 release ude
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Hotfix/64 release ude
Hotfix/64-releaseUDE
into
master
Overview
0
Commits
2
Pipelines
1
Changes
5
Merged
Petar Hristov
requested to merge
Hotfix/64-releaseUDE
into
master
3 years ago
Overview
0
Commits
2
Pipelines
1
Changes
5
Expand
rpdm/issues#64
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
2b586214
2 commits,
3 years ago
5 files
+
102
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
src/Migrations/Migrations/Migration202109161043UdeResources.cs
0 → 100644
+
51
−
0
Options
using
Coscine.Configuration
;
using
FluentMigrator
;
namespace
Coscine.Migrations.Migrations
{
//yyyymmddhhmm
[
Migration
(
202109161043
)]
public
class
Migration202109161043UdeResources
:
Migration
{
public
override
void
Down
()
{
Execute
.
EmbeddedScript
(
"Migration202109161043UdeResources_down.sql"
);
Delete
.
Column
(
"AccessKey"
).
FromTable
(
"RDSResourceType"
);
Delete
.
Column
(
"SecretKey"
).
FromTable
(
"RDSResourceType"
);
Delete
.
Column
(
"Endpoint"
).
FromTable
(
"RDSResourceType"
);
Delete
.
FromTable
(
"ResourceTypes"
).
Row
(
new
{
DisplayName
=
"rdss3ude"
});
Delete
.
FromTable
(
"ResourceTypes"
).
Row
(
new
{
DisplayName
=
"rdsude"
});
}
public
override
void
Up
()
{
var
configuration
=
new
ConsulConfiguration
();
// Make nullable, as we extend the table, which already has rows
Alter
.
Table
(
"RDSResourceType"
)
.
AddColumn
(
"AccessKey"
).
AsString
(
200
).
Nullable
()
.
AddColumn
(
"SecretKey"
).
AsString
(
200
).
Nullable
()
.
AddColumn
(
"Endpoint"
).
AsString
(
200
).
Nullable
();
// Insert missing data
Update
.
Table
(
"RDSResourceType"
).
Set
(
new
{
AccessKey
=
configuration
.
GetString
(
"coscine/global/rds/ecs-rwth/rds/object_user_name"
)
}).
AllRows
();
Update
.
Table
(
"RDSResourceType"
).
Set
(
new
{
SecretKey
=
configuration
.
GetString
(
"coscine/global/rds/ecs-rwth/rds/object_user_secretkey"
)
}).
AllRows
();
Update
.
Table
(
"RDSResourceType"
).
Set
(
new
{
Endpoint
=
configuration
.
GetString
(
"coscine/global/rds/ecs-rwth/rds/s3_endpoint"
)
}).
AllRows
();
// Make NotNullable
Alter
.
Table
(
"RDSResourceType"
)
.
AlterColumn
(
"AccessKey"
).
AsString
(
200
).
NotNullable
()
.
AlterColumn
(
"SecretKey"
).
AsString
(
200
).
NotNullable
()
.
AlterColumn
(
"Endpoint"
).
AsString
(
200
).
NotNullable
();
// Add resourcetypes
Insert
.
IntoTable
(
"ResourceTypes"
).
Row
(
new
{
DisplayName
=
"rdss3ude"
});
Insert
.
IntoTable
(
"ResourceTypes"
).
Row
(
new
{
DisplayName
=
"rdsude"
});
// Add quotas
Execute
.
EmbeddedScript
(
"Migration202109161043UdeResources_up.sql"
);
}
}
}
Loading