Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
grade
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton Yushko
grade
Commits
b888bd25
Commit
b888bd25
authored
10 years ago
by
PavelBegunkov
Committed by
xamgore
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Forgotten sql fixes for `logs_binds` table
parent
545b402b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
db/fixes/28_07_15.sql
+48
-0
48 additions, 0 deletions
db/fixes/28_07_15.sql
with
48 additions
and
0 deletions
db/fixes/28_07_15.sql
0 → 100644
+
48
−
0
View file @
b888bd25
CREATE
TABLE
IF
NOT
EXISTS
`logs_binds_students`
(
`ID`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`DisciplineID`
int
(
11
)
NOT
NULL
,
`TeacherID`
int
(
11
)
NOT
NULL
,
`StudentID`
int
(
11
)
NOT
NULL
,
`Date`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`Type`
enum
(
'attach'
,
'detach'
)
NOT
NULL
,
PRIMARY
KEY
(
`ID`
),
KEY
`TeacherID`
(
`TeacherID`
),
KEY
`DisciplineID`
(
`DisciplineID`
),
KEY
`StudentID`
(
`StudentID`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
--
-- Структура таблицы `logs_binds_groups`
--
CREATE
TABLE
IF
NOT
EXISTS
`logs_binds_groups`
(
`ID`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`DisciplineID`
int
(
11
)
NOT
NULL
,
`TeacherID`
int
(
11
)
NOT
NULL
,
`GroupID`
int
(
11
)
NOT
NULL
,
`Date`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`Type`
enum
(
'attach'
,
'detach'
)
NOT
NULL
,
PRIMARY
KEY
(
`ID`
),
KEY
`TeacherID`
(
`TeacherID`
),
KEY
`DisciplineID`
(
`DisciplineID`
),
KEY
`GroupID`
(
`GroupID`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
--
-- Ограничения внешнего ключа таблицы `logs_binds_students`
--
ALTER
TABLE
`logs_binds_students`
ADD
CONSTRAINT
`logs_binds_students_ibfk_3`
FOREIGN
KEY
(
`StudentID`
)
REFERENCES
`students`
(
`ID`
),
ADD
CONSTRAINT
`logs_binds_students_ibfk_1`
FOREIGN
KEY
(
`DisciplineID`
)
REFERENCES
`disciplines`
(
`ID`
),
ADD
CONSTRAINT
`logs_binds_students_ibfk_2`
FOREIGN
KEY
(
`TeacherID`
)
REFERENCES
`teachers`
(
`ID`
);
--
-- Ограничения внешнего ключа таблицы `logs_binds_groups`
--
ALTER
TABLE
`logs_binds_groups`
ADD
CONSTRAINT
`logs_binds_groups_ibfk_3`
FOREIGN
KEY
(
`GroupID`
)
REFERENCES
`study_groups`
(
`ID`
),
ADD
CONSTRAINT
`logs_binds_groups_ibfk_1`
FOREIGN
KEY
(
`DisciplineID`
)
REFERENCES
`disciplines`
(
`ID`
),
ADD
CONSTRAINT
`logs_binds_groups_ibfk_2`
FOREIGN
KEY
(
`TeacherID`
)
REFERENCES
`teachers`
(
`ID`
);
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