Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
00485a57
Commit
00485a57
authored
9 years ago
by
Adriaan Renting
Browse files
Options
Downloads
Patches
Plain Diff
Task #8580: Initial Resource Allocation Database creation script
parent
6c667fd3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitattributes
+1
-0
1 addition, 0 deletions
.gitattributes
SAS/ResourceAssignment/ResourceAllocationDatabase/sql/create_database.sql
+174
-0
174 additions, 0 deletions
...gnment/ResourceAllocationDatabase/sql/create_database.sql
with
175 additions
and
0 deletions
.gitattributes
+
1
−
0
View file @
00485a57
...
...
@@ -4816,6 +4816,7 @@ SAS/OTDB/src/setStatus.conf -text
SAS/OTDB/test/tBrokenHardware.cc -text
SAS/OTDB/test/tMetadata.cc -text
SAS/OTDB/test/tQueryPIC.cc -text
SAS/ResourceAssignment/ResourceAllocationDatabase/sql/create_database.sql -text
SAS/Scheduler/src/.default_settings.set -text
SAS/Scheduler/src/LOFAR_libScheduler.pro -text
SAS/Scheduler/src/conflictdialog.ui -text
...
...
This diff is collapsed.
Click to expand it.
SAS/ResourceAssignment/ResourceAllocationDatabase/sql/create_database.sql
0 → 100644
+
174
−
0
View file @
00485a57
-- DROP DATABASE IF EXISTS resourceallocation;
-- CREATE DATABASE resourceallocation
-- WITH OWNER = renting
-- ENCODING = 'UTF8'
-- TABLESPACE = pg_default
-- LC_COLLATE = 'en_US.UTF-8'
-- LC_CTYPE = 'en_US.UTF-8'
-- CONNECTION LIMIT = -1;
--CREATE SCHEMA resourceallocation;
--SET SCHEMA 'resourceallocation';
-- USE resourceassignment;
BEGIN
;
DROP
TABLE
IF
EXISTS
resource
;
CREATE
TABLE
resource
(
id
serial
NOT
NULL
,
name
text
NOT
NULL
,
type_id
integer
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource
OWNER
TO
renting
;
-- Could this be a CREATE TYPE?
DROP
TABLE
IF
EXISTS
resource_type
;
CREATE
TABLE
resource_type
(
id
serial
NOT
NULL
,
name
text
NOT
NULL
,
unit_id
integer
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_type
OWNER
TO
renting
;
-- Could this be a CREATE TYPE?
DROP
TABLE
IF
EXISTS
unit
;
CREATE
TABLE
unit
(
id
serial
NOT
NULL
,
units
text
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
unit
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_to_resource_group
;
CREATE
TABLE
resource_to_resource_group
(
id
serial
NOT
NULL
,
child_id
integer
NOT
NULL
,
parent_id
integer
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_to_resource_group
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_group
;
CREATE
TABLE
resource_group
(
id
serial
NOT
NULL
,
name
text
NOT
NULL
,
type_id
integer
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_group
OWNER
TO
renting
;
-- Could this be a CREATE TYPE?
DROP
TABLE
IF
EXISTS
resource_group_type
;
CREATE
TABLE
resource_group_type
(
id
serial
NOT
NULL
,
name
text
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_group_type
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_group_to_resource_group
;
CREATE
TABLE
resource_group_to_resource_group
(
id
serial
NOT
NULL
,
child_id
integer
NOT
NULL
,
parent_id
integer
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_group_to_resource_group
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_claim
;
CREATE
TABLE
resource_claim
(
id
serial
NOT
NULL
,
resource_id
integer
NOT
NULL
,
task_id
integer
NOT
NULL
,
starttime
timestamp
NOT
NULL
,
endtime
timestamp
NOT
NULL
,
status_id
integer
NOT
NULL
,
claim_endtime
timestamp
NOT
NULL
,
claim_size
bigint
NOT
NULL
,
username
text
,
user_id
integer
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_claim
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_claim_status
;
CREATE
TABLE
resource_claim_status
(
id
serial
NOT
NULL
,
name
text
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_claim_status
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
task
;
CREATE
TABLE
task
(
id
serial
NOT
NULL
,
mom_id
integer
,
otdb_id
integer
,
status_id
integer
NOT
NULL
,
type_id
integer
NOT
NULL
,
specification_id
integer
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
task
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
task_type
;
CREATE
TABLE
task_type
(
id
serial
NOT
NULL
,
name
text
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
task_type
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
specification
;
CREATE
TABLE
specification
(
id
serial
NOT
NULL
,
content
text
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
specification
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_capacity
;
CREATE
TABLE
resource_capacity
(
id
serial
NOT
NULL
,
resource_id
integer
NOT
NULL
,
available
bigint
NOT
NULL
,
total
bigint
NOT
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_capacity
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_availability
;
CREATE
TABLE
resource_availability
(
id
serial
NOT
NULL
,
resource_id
integer
NOT
NULL
,
available
bool
NOt
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_availability
OWNER
TO
renting
;
DROP
TABLE
IF
EXISTS
resource_group_availability
;
CREATE
TABLE
resource_group_availability
(
id
serial
NOT
NULL
,
resource_group_id
integer
NOT
NULL
,
available
bool
NOt
NULL
,
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
ALTER
TABLE
resource_group_availability
OWNER
TO
renting
;
COMMIT
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment