Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
Jannik Hellenkamp
website
Commits
bbef90c0
Commit
bbef90c0
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Added IF NOT EXISTS flag to schema
parent
96d28ccc
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
db_schema.sql
+16
-16
16 additions, 16 deletions
db_schema.sql
with
16 additions
and
16 deletions
db_schema.sql
+
16
−
16
View file @
bbef90c0
BEGIN
TRANSACTION
;
CREATE
TABLE
`accesslog`
(
CREATE
TABLE
IF
NOT
EXISTS
`accesslog`
(
`logfile`
varchar
(
255
)
NOT
NULL
,
`vhost`
varchar
(
30
)
DEFAULT
NULL
,
`path`
varchar
(
255
)
NOT
NULL
,
...
...
@@ -9,14 +9,14 @@ CREATE TABLE `accesslog` (
`volume`
bigint
(
20
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
logfile
,
path
,
timestamp
)
);
CREATE
TABLE
`areas`
(
CREATE
TABLE
IF
NOT
EXISTS
`areas`
(
`area`
varchar
(
20
)
NOT
NULL
PRIMARY
KEY
,
`abbreviation`
varchar
(
10
)
NOT
NULL
,
`default`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`rank`
INTEGER
DEFAULT
NULL
,
`coordinates`
varchar
(
30
)
NOT
NULL
);
CREATE
TABLE
`changelog`
(
CREATE
TABLE
IF
NOT
EXISTS
`changelog`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`when`
datetime
NOT
NULL
,
`who`
INTEGER
NOT
NULL
,
...
...
@@ -28,7 +28,7 @@ CREATE TABLE `changelog` (
`value_new`
text
NOT
NULL
,
`executed`
text
NOT
NULL
);
CREATE
TABLE
`courses_data`
(
CREATE
TABLE
IF
NOT
EXISTS
`courses_data`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`visible`
INTEGER
NOT
NULL
,
`listed`
INTEGER
NOT
NULL
DEFAULT
'1'
,
...
...
@@ -51,13 +51,13 @@ CREATE TABLE `courses_data` (
`responsible`
text
NOT
NULL
,
`feed_url`
text
NOT
NULL
);
CREATE
TABLE
`filesizes`
(
CREATE
TABLE
IF
NOT
EXISTS
`filesizes`
(
`path`
varchar
(
255
)
NOT
NULL
PRIMARY
KEY
,
`size`
bigint
(
20
)
NOT
NULL
DEFAULT
'0'
,
`duration`
float
DEFAULT
NULL
,
`basename`
varchar
(
255
)
NOT
NULL
);
CREATE
TABLE
`formats`
(
CREATE
TABLE
IF
NOT
EXISTS
`formats`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`description`
text
NOT
NULL
,
`keywords`
text
NOT
NULL
,
...
...
@@ -66,7 +66,7 @@ CREATE TABLE `formats` (
`prio`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`player_prio`
INTEGER
NOT
NULL
DEFAULT
'0'
);
CREATE
TABLE
`lectures_data`
(
CREATE
TABLE
IF
NOT
EXISTS
`lectures_data`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`course_id`
INTEGER
NOT
NULL
,
`visible`
INTEGER
NOT
NULL
DEFAULT
'1'
,
...
...
@@ -86,20 +86,20 @@ CREATE TABLE `lectures_data` (
`jumplist`
text
NOT
NULL
,
`titlefile`
varchar
(
255
)
NOT
NULL
);
CREATE
TABLE
`places`
(
CREATE
TABLE
IF
NOT
EXISTS
`places`
(
`place`
varchar
(
20
)
NOT
NULL
PRIMARY
KEY
,
`name`
text
NOT
NULL
,
`area`
varchar
(
20
)
NOT
NULL
,
`campus_room`
varchar
(
20
)
NOT
NULL
,
`campus_name`
varchar
(
30
)
NOT
NULL
);
CREATE
TABLE
`site_texts`
(
CREATE
TABLE
IF
NOT
EXISTS
`site_texts`
(
`key`
varchar
(
64
)
NOT
NULL
PRIMARY
KEY
,
`value`
text
NOT
NULL
,
`modified_when`
datetime
NOT
NULL
,
`modified_by`
text
NOT
NULL
);
CREATE
TABLE
`streams`
(
CREATE
TABLE
IF
NOT
EXISTS
`streams`
(
`handle`
varchar
(
32
)
NOT
NULL
PRIMARY
KEY
,
`active`
INTEGER
NOT
NULL
,
`visible`
INTEGER
NOT
NULL
,
...
...
@@ -107,7 +107,7 @@ CREATE TABLE `streams` (
`description`
text
NOT
NULL
,
`poster`
text
NOT
NULL
);
CREATE
TABLE
`stream_stats`
(
CREATE
TABLE
IF
NOT
EXISTS
`stream_stats`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`handle`
varchar
(
32
)
NOT
NULL
,
`lecture`
INTEGER
NOT
NULL
,
...
...
@@ -118,7 +118,7 @@ CREATE TABLE `stream_stats` (
`hls_720p`
INTEGER
NOT
NULL
DEFAULT
'0'
,
`hls_360p`
INTEGER
NOT
NULL
DEFAULT
'0'
);
CREATE
TABLE
`users`
(
CREATE
TABLE
IF
NOT
EXISTS
`users`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`name`
varchar
(
32
)
NOT
NULL
,
`realname`
text
NOT
NULL
,
...
...
@@ -128,7 +128,7 @@ CREATE TABLE `users` (
`calendar_key`
varchar
(
40
)
NOT
NULL
,
`rfc6238`
varchar
(
20
)
NOT
NULL
);
CREATE
TABLE
`videos_data`
(
CREATE
TABLE
IF
NOT
EXISTS
`videos_data`
(
`id`
INTEGER
NOT
NULL
PRIMARY
KEY
AUTOINCREMENT
,
`lecture_id`
INTEGER
NOT
NULL
,
`visible`
INTEGER
NOT
NULL
DEFAULT
'1'
,
...
...
@@ -146,7 +146,7 @@ CREATE TABLE `videos_data` (
`video_format`
INTEGER
NOT
NULL
,
`hash`
varchar
(
32
)
NOT
NULL
);
CREATE
VIEW
`courses`
AS
select
*
from
`courses_data`
where
(
not
(
`courses_data`
.
`deleted`
));
CREATE
VIEW
`lectures`
AS
select
*
from
`lectures_data`
where
(
not
(
`lectures_data`
.
`deleted`
));
CREATE
VIEW
`videos`
AS
select
*
from
`videos_data`
where
(
not
(
`videos_data`
.
`deleted`
));
CREATE
VIEW
IF
NOT
EXISTS
`courses`
AS
select
*
from
`courses_data`
where
(
not
(
`courses_data`
.
`deleted`
));
CREATE
VIEW
IF
NOT
EXISTS
`lectures`
AS
select
*
from
`lectures_data`
where
(
not
(
`lectures_data`
.
`deleted`
));
CREATE
VIEW
IF
NOT
EXISTS
`videos`
AS
select
*
from
`videos_data`
where
(
not
(
`videos_data`
.
`deleted`
));
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