Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Chronos
Commits
561d370c
Verified
Commit
561d370c
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Add db indexes. Advances BiscuIT-ng#55.
parent
0b4bda91
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
biscuit/apps/chronos/migrations/0002_db_indexes.py
+30
-0
30 additions, 0 deletions
biscuit/apps/chronos/migrations/0002_db_indexes.py
biscuit/apps/chronos/models.py
+4
-0
4 additions, 0 deletions
biscuit/apps/chronos/models.py
with
34 additions
and
0 deletions
biscuit/apps/chronos/migrations/0002_db_indexes.py
0 → 100644
+
30
−
0
View file @
561d370c
# Generated by Django 2.2.4 on 2019-09-04 13:22
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
core
'
,
'
0001_initial
'
),
(
'
chronos
'
,
'
0001_initial
'
),
]
operations
=
[
migrations
.
AlterUniqueTogether
(
name
=
'
lessonsubstitution
'
,
unique_together
=
{(
'
school
'
,
'
lesson_period
'
,
'
week
'
)},
),
migrations
.
AddIndex
(
model_name
=
'
lesson
'
,
index
=
models
.
Index
(
fields
=
[
'
date_start
'
,
'
date_end
'
],
name
=
'
chronos_les_date_st_5ecc62_idx
'
),
),
migrations
.
AddIndex
(
model_name
=
'
lessonperiod
'
,
index
=
models
.
Index
(
fields
=
[
'
lesson
'
,
'
period
'
],
name
=
'
chronos_les_lesson__05250e_idx
'
),
),
migrations
.
AddIndex
(
model_name
=
'
timeperiod
'
,
index
=
models
.
Index
(
fields
=
[
'
time_start
'
,
'
time_end
'
],
name
=
'
chronos_tim_time_st_491e4c_idx
'
),
),
]
This diff is collapsed.
Click to expand it.
biscuit/apps/chronos/models.py
+
4
−
0
View file @
561d370c
...
@@ -43,6 +43,7 @@ class TimePeriod(SchoolRelated):
...
@@ -43,6 +43,7 @@ class TimePeriod(SchoolRelated):
class
Meta
:
class
Meta
:
unique_together
=
[[
'
school
'
,
'
weekday
'
,
'
period
'
]]
unique_together
=
[[
'
school
'
,
'
weekday
'
,
'
period
'
]]
ordering
=
[
'
weekday
'
,
'
period
'
]
ordering
=
[
'
weekday
'
,
'
period
'
]
indexes
=
[
models
.
Index
(
fields
=
[
'
time_start
'
,
'
time_end
'
])]
class
Subject
(
SchoolRelated
):
class
Subject
(
SchoolRelated
):
...
@@ -101,6 +102,7 @@ class Lesson(SchoolRelated):
...
@@ -101,6 +102,7 @@ class Lesson(SchoolRelated):
class
Meta
:
class
Meta
:
ordering
=
[
'
date_start
'
]
ordering
=
[
'
date_start
'
]
indexes
=
[
models
.
Index
(
fields
=
[
'
date_start
'
,
'
date_end
'
])]
class
LessonSubstitution
(
SchoolRelated
):
class
LessonSubstitution
(
SchoolRelated
):
...
@@ -118,6 +120,7 @@ class LessonSubstitution(SchoolRelated):
...
@@ -118,6 +120,7 @@ class LessonSubstitution(SchoolRelated):
room
=
models
.
ForeignKey
(
'
Room
'
,
models
.
CASCADE
,
null
=
True
)
room
=
models
.
ForeignKey
(
'
Room
'
,
models
.
CASCADE
,
null
=
True
)
class
Meta
:
class
Meta
:
unique_together
=
[[
'
school
'
,
'
lesson_period
'
,
'
week
'
]]
ordering
=
[
'
lesson_period__lesson__date_start
'
,
'
week
'
,
ordering
=
[
'
lesson_period__lesson__date_start
'
,
'
week
'
,
'
lesson_period__period__weekday
'
,
'
lesson_period__period__period
'
]
'
lesson_period__period__weekday
'
,
'
lesson_period__period__period
'
]
...
@@ -165,3 +168,4 @@ class LessonPeriod(SchoolRelated):
...
@@ -165,3 +168,4 @@ class LessonPeriod(SchoolRelated):
class
Meta
:
class
Meta
:
ordering
=
[
'
lesson__date_start
'
,
'
period__weekday
'
,
'
period__period
'
]
ordering
=
[
'
lesson__date_start
'
,
'
period__weekday
'
,
'
period__period
'
]
indexes
=
[
models
.
Index
(
fields
=
[
'
lesson
'
,
'
period
'
])]
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