-
Notifications
You must be signed in to change notification settings - Fork 0
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
2025-02-04-add_vl_pipe_section_pipe_dn #85
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
…ub.com/teksi/district_heating into 2025-02-04-add_vl_pipe_section_pipe_dn
|
Nominal_diameter is defined as text So we need to modify that. |
Change type of column -- see https://stackoverflow.com/questions/7162903/how-to-alter-a-columns-data-type-in-a-postgresql-table (version that allows to have already data in db) |
|
@ponceta Any idea how to change column type from text to integer in a more "safe" way? Do we need to consider to keep existing data? |
Maybe more idea to deal with that issue: https://stackoverflow.com/questions/10518258/typecast-string-to-integer |
ALTER TABLE tdh_od.pipe_section | ||
DROP COLUMN IF EXISTS nominal_diameter; | ||
|
||
ALTER TABLE tdh_od.pipe_section ADD COLUMN nominal_diameter integer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALTER TABLE tdh_od.pipe_section ADD COLUMN nominal_diameter integer; | |
ALTER TABLE tdh_od.pipe_section ADD COLUMN material integer; |
/* AJOUT DE LA TABLE DES DIAMETRES NOMINAUX DE CONDUITES () */ | ||
/*---------------------------------------------------------------------------------------*/ | ||
|
||
CREATE TABLE tdh_vl.pipe_section_pipe_dn () INHERITS (tdh_vl.value_list_base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CREATE TABLE tdh_vl.pipe_section_pipe_dn () INHERITS (tdh_vl.value_list_base); | |
CREATE TABLE tdh_vl.pipe material () INHERITS (tdh_vl.value_list_base); |
@@ -34,6 +34,8 @@ psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/changelogs/0001/04_tdh_ | |||
|
|||
# psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/changelogs/0001/05_data_model_extensions.sql | |||
|
|||
psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/changelogs/0001/05_add_vl_pipe_section_pipe_dn.sql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/changelogs/0001/05_add_vl_pipe_section_pipe_dn.sql | |
psql "service=${PGSERVICE}" -v ON_ERROR_STOP=1 -f ${DIR}/changelogs/0001/05_add_vl_pipe_material.sql |
👍 on removing nominal diameter from table pipe_section Change requested : name the material table tdh_vl.material and the corresponding foreign key pipe_section.material |
We had a similar case fixed by @rbovard on qwat/qwat-data-model@a44e1a0 |
Should solve #53