-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Paul Bui-Quang <[email protected]> Co-authored-by: hicham <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: AnddyAnddy <[email protected]> Co-authored-by: anddy <[email protected]>
- Loading branch information
1 parent
ed47e26
commit 7c053fc
Showing
60 changed files
with
1,369 additions
and
1,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 4.1.7 on 2023-07-28 13:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
trim_trailing_commas = "UPDATE accesses_perimeter SET above_levels_ids=TRIM(trailing ',' from above_levels_ids)" | ||
set_level_aphp = "UPDATE accesses_perimeter SET level=1 WHERE parent_id IS NULL" | ||
set_level_other_perimeters = """UPDATE accesses_perimeter SET level=array_length(string_to_array(above_levels_ids, ','), 1)+1 | ||
WHERE parent_id IS NOT NULL AND above_levels_ids IS NOT NULL""" | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accesses', '0004_set_created_by_updated_by_for_accesses'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='perimeter', | ||
name='level', | ||
field=models.IntegerField(blank=True, null=True), | ||
), | ||
migrations.RunSQL(sql=trim_trailing_commas), | ||
migrations.RunSQL(sql=set_level_aphp), | ||
migrations.RunSQL(sql=set_level_other_perimeters), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.1.7 on 2023-08-11 13:42 | ||
|
||
from django.db import migrations, models | ||
|
||
unify_datetime_fields = """UPDATE accesses_access | ||
SET start_datetime_new = COALESCE(manual_start_datetime, start_datetime), | ||
end_datetime_new = COALESCE(manual_end_datetime, end_datetime) | ||
""" | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accesses', '0005_perimeter_level'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='access', | ||
name='end_datetime_new', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='access', | ||
name='start_datetime_new', | ||
field=models.DateTimeField(blank=True, null=True), | ||
), | ||
migrations.RunSQL(sql=unify_datetime_fields) | ||
] |
39 changes: 39 additions & 0 deletions
39
accesses/migrations/0007_remove_access_end_datetime_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by Django 4.1.7 on 2023-08-11 15:00 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accesses', '0006_unify_access_datetime_fields'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='access', | ||
name='end_datetime', | ||
), | ||
migrations.RemoveField( | ||
model_name='access', | ||
name='manual_end_datetime', | ||
), | ||
migrations.RemoveField( | ||
model_name='access', | ||
name='manual_start_datetime', | ||
), | ||
migrations.RemoveField( | ||
model_name='access', | ||
name='start_datetime', | ||
), | ||
migrations.RenameField( | ||
model_name='access', | ||
old_name='end_datetime_new', | ||
new_name='end_datetime', | ||
), | ||
migrations.RenameField( | ||
model_name='access', | ||
old_name='start_datetime_new', | ||
new_name='start_datetime', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 4.1.7 on 2023-08-22 13:13 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accesses', '0007_remove_access_end_datetime_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='perimeter', | ||
name='count_allowed_users', | ||
field=models.IntegerField(blank=True, default=0, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='perimeter', | ||
name='count_allowed_users_above_levels', | ||
field=models.IntegerField(blank=True, default=0, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='perimeter', | ||
name='count_allowed_users_inferior_levels', | ||
field=models.IntegerField(blank=True, default=0, null=True), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
accesses/migrations/0009_role_right_read_admin_accesses_above_levels.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.7 on 2023-08-25 14:25 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('accesses', '0008_count_users_on_perimeters'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='role', | ||
name='right_read_admin_accesses_above_levels', | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.