Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
AURA
tank
Commits
0a7c6125
Commit
0a7c6125
authored
6 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
some more simple sql script
parent
c8caddcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
store/mysql-scripts/test-fk.sql
+42
-0
42 additions, 0 deletions
store/mysql-scripts/test-fk.sql
with
42 additions
and
0 deletions
store/mysql-scripts/test-fk.sql
0 → 100644
+
42
−
0
View file @
0a7c6125
/* should succeed */
insert
into
groups
(
name
)
values
(
'test'
);
/* should fail */
insert
into
files
(
size
)
values
(
100
);
insert
into
files
(
group_name
,
size
)
values
(
'invalid'
,
101
);
/* should succeed */
insert
into
files
(
group_name
,
size
)
values
(
'test'
,
101
);
insert
into
files
(
group_name
,
size
)
values
(
'test'
,
102
);
select
*
from
files
;
/* should fail */
insert
into
playlists
()
values
();
/* should succeed */
insert
into
playlists
(
group_name
)
values
(
'test'
);
/* should fail */
insert
into
playlist_entries
(
uri
)
values
(
'http://stream.example.com/live.mp3'
);
insert
into
playlist_entries
(
playlist_id
,
uri
)
values
(
1
,
'http://stream.example.com/live.mp3'
);
insert
into
playlist_entries
(
playlist_id
,
line_num
,
uri
)
values
(
17
,
1
,
'http://stream.example.com/live.mp3'
);
/* should succeed */
insert
into
playlist_entries
(
playlist_id
,
line_num
,
uri
)
values
(
1
,
1
,
'http://stream.example.com/live.mp3'
);
/* should fail */
insert
into
playlist_entries
(
playlist_id
,
line_num
,
uri
)
values
(
1
,
1
,
'http://stream.example.com/other.mp3'
);
insert
into
playlist_entries
(
playlist_id
,
line_num
,
file_id
)
values
(
1
,
4
,
23
);
/* should succeed */
insert
into
playlist_entries
(
playlist_id
,
line_num
,
file_id
)
values
(
1
,
4
,
2
);
delete
from
files
where
id
=
1
;
/* should fail */
delete
from
files
where
id
=
2
;
/* should succeed */
delete
from
playlists
where
id
=
1
;
delete
from
files
where
id
=
2
;
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