-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🦺(migration) add back the migration folders to linter
Previous commit add "core/tests/migrations". The linter could not pass on it because all the migration folders were excluded from the linter. We remove this exclusion, tests and migrations can now be linted and formatted automatically.
- Loading branch information
Showing
18 changed files
with
840 additions
and
253 deletions.
There are no files selected for viewing
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
110 changes: 86 additions & 24 deletions
110
src/backend/core/migrations/0003_document_link_reach_document_link_role_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 |
---|---|---|
@@ -1,52 +1,114 @@ | ||
# Generated by Django 5.1 on 2024-09-08 16:55 | ||
|
||
import django.db.models.deletion | ||
import uuid | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0002_create_pg_trgm_extension'), | ||
("core", "0002_create_pg_trgm_extension"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='document', | ||
name='link_reach', | ||
field=models.CharField(choices=[('restricted', 'Restricted'), ('authenticated', 'Authenticated'), ('public', 'Public')], default='authenticated', max_length=20), | ||
model_name="document", | ||
name="link_reach", | ||
field=models.CharField( | ||
choices=[ | ||
("restricted", "Restricted"), | ||
("authenticated", "Authenticated"), | ||
("public", "Public"), | ||
], | ||
default="authenticated", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name='document', | ||
name='link_role', | ||
field=models.CharField(choices=[('reader', 'Reader'), ('editor', 'Editor')], default='reader', max_length=20), | ||
model_name="document", | ||
name="link_role", | ||
field=models.CharField( | ||
choices=[("reader", "Reader"), ("editor", "Editor")], | ||
default="reader", | ||
max_length=20, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='document', | ||
name='is_public', | ||
model_name="document", | ||
name="is_public", | ||
field=models.BooleanField(null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='user', | ||
name='language', | ||
field=models.CharField(choices="(('en-us', 'English'), ('fr-fr', 'French'))", default='en-us', help_text='The language in which the user wants to see the interface.', max_length=10, verbose_name='language'), | ||
model_name="user", | ||
name="language", | ||
field=models.CharField( | ||
choices="(('en-us', 'English'), ('fr-fr', 'French'))", | ||
default="en-us", | ||
help_text="The language in which the user wants to see the interface.", | ||
max_length=10, | ||
verbose_name="language", | ||
), | ||
), | ||
migrations.CreateModel( | ||
name='LinkTrace', | ||
name="LinkTrace", | ||
fields=[ | ||
('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='primary key for the record as UUID', primary_key=True, serialize=False, verbose_name='id')), | ||
('created_at', models.DateTimeField(auto_now_add=True, help_text='date and time at which a record was created', verbose_name='created on')), | ||
('updated_at', models.DateTimeField(auto_now=True, help_text='date and time at which a record was last updated', verbose_name='updated on')), | ||
('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='link_traces', to='core.document')), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='link_traces', to=settings.AUTH_USER_MODEL)), | ||
( | ||
"id", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
editable=False, | ||
help_text="primary key for the record as UUID", | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="id", | ||
), | ||
), | ||
( | ||
"created_at", | ||
models.DateTimeField( | ||
auto_now_add=True, | ||
help_text="date and time at which a record was created", | ||
verbose_name="created on", | ||
), | ||
), | ||
( | ||
"updated_at", | ||
models.DateTimeField( | ||
auto_now=True, | ||
help_text="date and time at which a record was last updated", | ||
verbose_name="updated on", | ||
), | ||
), | ||
( | ||
"document", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="link_traces", | ||
to="core.document", | ||
), | ||
), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="link_traces", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
options={ | ||
'verbose_name': 'Document/user link trace', | ||
'verbose_name_plural': 'Document/user link traces', | ||
'db_table': 'impress_link_trace', | ||
'constraints': [models.UniqueConstraint(fields=('user', 'document'), name='unique_link_trace_document_user', violation_error_message='A link trace already exists for this document/user.')], | ||
"verbose_name": "Document/user link trace", | ||
"verbose_name_plural": "Document/user link traces", | ||
"db_table": "impress_link_trace", | ||
"constraints": [ | ||
models.UniqueConstraint( | ||
fields=("user", "document"), | ||
name="unique_link_trace_document_user", | ||
violation_error_message="A link trace already exists for this document/user.", | ||
) | ||
], | ||
}, | ||
), | ||
] |
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
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.