Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common sql default value, remove db_column french #3055

Merged
merged 33 commits into from
Apr 8, 2022

Conversation

LePetitTim
Copy link
Contributor

No description provided.

@cypress
Copy link

cypress bot commented Apr 5, 2022



Test summary

20 0 0 0


Run details

Project Geotrek-admin
Status Passed
Commit 34702e5
Started Apr 8, 2022 1:42 PM
Ended Apr 8, 2022 1:44 PM
Duration 02:45 💡
OS Linux Ubuntu - 20.04
Browser Electron 94

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #3055 (34702e5) into master (c5aba15) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3055   +/-   ##
=======================================
  Coverage   97.48%   97.48%           
=======================================
  Files         261      261           
  Lines       17809    17809           
=======================================
  Hits        17361    17361           
  Misses        448      448           
Impacted Files Coverage Δ
geotrek/common/models.py 98.72% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5aba15...34702e5. Read the comment docs.

help_text=_("Original creator"))
title = models.CharField(blank=True, default='', max_length=128,
db_column='titre', verbose_name=_(u"Filename"),
verbose_name=_(u"Filename"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
verbose_name=_(u"Filename"),
verbose_name=_("Filename"),

help_text=_("Renames the file"))
legend = models.CharField(blank=True, default='', max_length=128,
db_column='legende', verbose_name=_(u"Legend"),
verbose_name=_(u"Legend"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
verbose_name=_(u"Legend"),
verbose_name=_("Legend"),

@camillemonchicourt
Copy link
Member

Attention @IdrissaD, dans la prochaine version, on ajoute des valeurs par défaut sur tous les champs où cela est pertinent.
Et on en profite pour renommer en anglais les champs de la table des fichiers liés.

Il faudra alors revoir la vue du schéma de données qui fait appel à ces champs en français : https://github.com/PnX-SI/schema_randonnee/blob/master/geotrek/v_treks_schema.sql

@LePetitTim pour ceux qui ont des vues ou autres utilisant la BDD, il faudrait indiquer dans le Changelog les champs des attachments qui ont été renommés en anglais.

ALTER TABLE common_attachment ALTER COLUMN uuid SET DEFAULT gen_random_uuid();
ALTER TABLE common_attachment ALTER COLUMN attachment_video SET DEFAULT '';
ALTER TABLE common_attachment ALTER COLUMN attachment_link SET DEFAULT '';
-- filetype
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mettre une valeur par défaut sur le champs attachment_file, si on ne remplit que attachment_link ?

ALTER TABLE common_attachment ALTER COLUMN starred SET DEFAULT False;
ALTER TABLE common_attachment ALTER COLUMN is_image SET DEFAULT False;
ALTER TABLE common_attachment ALTER COLUMN date_insert SET DEFAULT now();
ALTER TABLE common_attachment ALTER COLUMN date_update SET DEFAULT now();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supprimer le champs creation_date de cette table qui ne semble pas utilisé et semble redondant avec date_insert ?

-- geom
ALTER TABLE core_topology ALTER COLUMN uuid SET DEFAULT gen_random_uuid();
-- geom_3d
ALTER TABLE core_topology ALTER COLUMN "length" SET DEFAULT 0.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ligne redondante, définie quelques lignes plus haut.

ALTER TABLE core_path ALTER COLUMN eid SET DEFAULT '';
ALTER TABLE core_path ALTER COLUMN draft SET DEFAULT False;
ALTER TABLE core_path ALTER COLUMN uuid SET DEFAULT gen_random_uuid();
ALTER TABLE core_path ALTER COLUMN geom_3d SET DEFAULT NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ALTER TABLE core_path ALTER COLUMN geom_3d SET DEFAULT NULL;
ALTER TABLE core_path ALTER COLUMN geom_3d SET DEFAULT NULL;

default is already null on nullable columns

ALTER TABLE core_topology ALTER COLUMN geom_need_update SET DEFAULT FALSE;
-- geom
ALTER TABLE core_topology ALTER COLUMN uuid SET DEFAULT gen_random_uuid();
ALTER TABLE core_topology ALTER COLUMN geom_3d SET DEFAULT NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ALTER TABLE core_topology ALTER COLUMN geom_3d SET DEFAULT NULL;
ALTER TABLE core_topology ALTER COLUMN geom_3d SET DEFAULT NULL;

idem

-- InterventionStatus
---------------------
-- status
ALTER TABLE maintenance_interventionstatus ALTER COLUMN "order" SET DEFAULT NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ALTER TABLE maintenance_interventionstatus ALTER COLUMN "order" SET DEFAULT NULL;
ALTER TABLE maintenance_interventionstatus ALTER COLUMN "order" SET DEFAULT NULL;

IDEM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants