Skip to content

Commit

Permalink
Fix latitude and longitude types
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed May 17, 2024
1 parent 9fea8b0 commit 4ad69e1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
DROP TABLE IF EXISTS galette_maps_coordinates CASCADE;
CREATE TABLE galette_maps_coordinates (
id_adh int(10) unsigned NOT NULL,
latitude real NOT NULL,
longitude real NOT NULL,
latitude decimal(9,6) NOT NULL,
longitude decimal(9,6) NOT NULL,
PRIMARY KEY (id_adh),
FOREIGN KEY (id_adh) REFERENCES galette_adherents (id_adh) ON DELETE CASCADE ON UPDATE CASCADE
);
4 changes: 2 additions & 2 deletions scripts/pgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
DROP TABLE IF EXISTS galette_maps_coordinates CASCADE;
CREATE TABLE galette_maps_coordinates (
id_adh integer REFERENCES galette_adherents (id_adh) ON DELETE CASCADE ON UPDATE CASCADE,
latitude real NOT NULL,
longitude real NOT NULL,
latitude decimal(9,6) NOT NULL,
longitude decimal(9,6) NOT NULL,
PRIMARY KEY (id_adh)
);
2 changes: 2 additions & 0 deletions scripts/upgrade-to-2.0.0-mysql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE galette_maps_coordinates CHANGE latitude latitude decimal(9,6) NOT NULL;
ALTER TABLE galette_maps_coordinates CHANGE longitude longitude decimal(9,6) NOT NULL;
2 changes: 2 additions & 0 deletions scripts/upgrade-to-2.0.0-pgsql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE galette_maps_coordinates ALTER COLUMN latitude TYPE decimal(9,6);
ALTER TABLE galette_maps_coordinates ALTER COLUMN longitude TYPE decimal(9,6);

0 comments on commit 4ad69e1

Please sign in to comment.