I am doing well on my celestial database project, and it is fun, although I don’t know when I’ll “need” a celestial database…unless i create my own website, which could be anotehr fun project!
Anyway my question is about this test:
Each "star" should have a foreign key that references one of the rows in galaxy
Is this test looking for data, or is it looking for table details? I’ve added the foreign key but the test isn’t passing. I don’t want to add data yet until I’m done building the structure due to task switching effort on my brain.
I need to add foreign keys for the other table and I assume i’m doing it correctly, so can continue but just wondered. I’m guessing it’s looking for real data since the subject of the test is “star” and not star
. Here is my star table so far.
+---------------------+-----------------------+-----------+----------+---------------------------------------+
| Column | Type | Collation | Nullable | Default |
+---------------------+-----------------------+-----------+----------+---------------------------------------+
| star_id | integer | | not null | nextval('star_star_id_seq'::regclass) |
| name | character varying(30) | | | |
| description | character varying(60) | | | |
| distance_from_earth | integer | | | |
| brightness | numeric(2,1) | | | |
| galaxy_id | integer | | | |
+---------------------+-----------------------+-----------+----------+---------------------------------------+
Indexes:
"star_pkey" PRIMARY KEY, btree (star_id)
Foreign-key constraints:
"star_galaxy_id_fkey" FOREIGN KEY (galaxy_id) REFERENCES galaxy(galaxy_id)