-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change le type des colonnes vers
double precision
- Loading branch information
Showing
6 changed files
with
91 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- Deploy tet:indicateur/artificialisation to pg | ||
|
||
BEGIN; | ||
|
||
create table indicateur_artificialisation | ||
( | ||
collectivite_id integer references collectivite primary key, | ||
total integer not null, | ||
activite integer not null, | ||
habitat integer not null, | ||
mixte integer not null, | ||
routiere integer not null, | ||
ferroviaire integer not null, | ||
inconnue integer not null | ||
); | ||
alter table indicateur_artificialisation | ||
enable row level security; | ||
create policy allow_read on indicateur_artificialisation for select using (true); | ||
|
||
create function | ||
indicateur_artificialisation(site_labellisation) | ||
returns setof indicateur_artificialisation | ||
rows 1 | ||
security definer | ||
begin | ||
atomic | ||
select ia | ||
from indicateur_artificialisation ia | ||
where ia.collectivite_id = $1.collectivite_id; | ||
end; | ||
comment on function indicateur_artificialisation(site_labellisation) is | ||
'Flux de consommation d’espaces, par destination entre 2009 et 2022'; | ||
|
||
COMMIT; |
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,8 +1,26 @@ | ||
-- Revert tet:indicateur/artificialisation from pg | ||
-- Deploy tet:indicateur/artificialisation to pg | ||
|
||
BEGIN; | ||
|
||
drop function indicateur_artificialisation(site_labellisation); | ||
drop table indicateur_artificialisation; | ||
alter table indicateur_artificialisation | ||
alter column total type integer using total::integer; | ||
|
||
alter table indicateur_artificialisation | ||
alter column activite type integer using activite::integer; | ||
|
||
alter table indicateur_artificialisation | ||
alter column habitat type integer using habitat::integer; | ||
|
||
alter table indicateur_artificialisation | ||
alter column mixte type integer using mixte::integer; | ||
|
||
alter table indicateur_artificialisation | ||
alter column routiere type integer using routiere::integer; | ||
|
||
alter table indicateur_artificialisation | ||
alter column ferroviaire type integer using ferroviaire::integer; | ||
|
||
alter table indicateur_artificialisation | ||
alter column inconnue type integer using inconnue::integer; | ||
|
||
COMMIT; |
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,8 @@ | ||
-- Revert tet:indicateur/artificialisation from pg | ||
|
||
BEGIN; | ||
|
||
drop function indicateur_artificialisation(site_labellisation); | ||
drop table indicateur_artificialisation; | ||
|
||
COMMIT; |
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 |
---|---|---|
|
@@ -545,3 +545,5 @@ taxonomie/personne 2023-11-07T08:58:36Z Florian <[email protected]> # Répare | |
|
||
indicateur/artificialisation 2023-11-16T13:12:35Z Florian <[email protected]> # Artificialisation des sols de 2009 à 2022 | ||
@v2.81.0 2023-11-16T14:13:44Z Florian <[email protected]> # Indicateur d'artificialisation des sols pour le site | ||
|
||
indicateur/artificialisation [indicateur/[email protected]] 2023-11-20T14:17:42Z Florian <[email protected]> # Change le type des colonnes en "double precision" |
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,7 @@ | ||
-- Verify tet:indicateur/artificialisation on pg | ||
|
||
BEGIN; | ||
|
||
-- XXX Add verifications here. | ||
|
||
ROLLBACK; |