Species Read - Order of ops:
router/routes.go router/api.go models/species_test.go models/species.go models/client.go datastore/migrations/addspecies.sql datastore/migrations/dropspecies.sql datastore/species_test.go datastore/species.go datastore/datastore.go api/species_test.go api/species.go api/handler.go
This commit is contained in:
parent
6fe6d5d189
commit
830a8805c9
13 changed files with 263 additions and 7 deletions
5
datastore/migrations/00003_AddSpecies_down.sql
Normal file
5
datastore/migrations/00003_AddSpecies_down.sql
Normal file
|
@ -0,0 +1,5 @@
|
|||
-- bactdb
|
||||
-- Matthew R Dillon
|
||||
|
||||
DROP TABLE species;
|
||||
|
15
datastore/migrations/00003_AddSpecies_up.sql
Normal file
15
datastore/migrations/00003_AddSpecies_up.sql
Normal file
|
@ -0,0 +1,15 @@
|
|||
-- bactdb
|
||||
-- Matthew Dillon
|
||||
|
||||
CREATE TABLE species (
|
||||
id BIGSERIAL NOT NULL,
|
||||
genusid BIGINT,
|
||||
speciesname CHARACTER VARYING(100),
|
||||
|
||||
createdat TIMESTAMP WITH TIME ZONE,
|
||||
updatedat TIMESTAMP WITH TIME ZONE,
|
||||
deletedat TIMESTAMP WITH TIME ZONE,
|
||||
|
||||
CONSTRAINT species_pkey PRIMARY KEY (id),
|
||||
FOREIGN KEY (genusid) REFERENCES genera(id)
|
||||
);
|
Reference in a new issue