User Tools

Site Tools


podoc:location_sql_table

Database Table Description of "location"

Name

location

Description

Purpose

Schema

CREATE TABLE location ( -- location is the place the photo was taken
  identifier            INTEGER NOT NULL PRIMARY KEY,
  place                 VARCHAR(300),
  state                 INTEGER REFERENCES state(identifier),
  country               INTEGER REFERENCES country(identifier),
  last_modified_date 	TIMESTAMP,
  users                 INTEGER REFERENCES users(identifier),
  city                  VARCHAR(300),
  latitude              VARCHAR(10),
  longitude             VARCHAR(10),
  private               BOOLEAN NOT NULL
);

References tables

  • country references country(identifier)
  • state references state(identifier)
  • users references users(identifier)

Is referenced by tables

  • photo(location) references identifier

None.

History

Used first

Version 2.5

Used last

Still in use

Schema change history

= Version 2.5 =

CREATE TABLE location ( -- location is the place the photo was taken
  identifier            INTEGER NOT NULL PRIMARY KEY,
  place                 VARCHAR(300),
  state                 INTEGER REFERENCES state(identifier),
  country               INTEGER REFERENCES country(identifier),
  last_modified_date 	TIMESTAMP,
  last_modifying_users  INTEGER REFERENCES users(identifier),
  city                  VARCHAR(300),
  latitude              VARCHAR(10),
  longitude             VARCHAR(10)
);

= Version 2.33 =

ALTER TABLE location RENAME last_modifying_users TO users;
 
ALTER TABLE location ADD private BOOLEAN;
UPDATE location SET private='f';
ALTER TABLE location ALTER private SET NOT NULL;
Data change history

= Version 2.31 =

-- Ensure referential integrity with the locations.
INSERT INTO location (identifier, place) VALUES (0, 'Unknown');
podoc/location_sql_table.txt · Last modified: 2007/04/20 13:38 by Luud