Last active
January 23, 2018 13:31
-
-
Save searls/eb2e9d25d03709df1debe11394b1454b to your computer and use it in GitHub Desktop.
It sorta looks like Rails fixtures can't handle joiner tables that have t.timestamps on them
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
caution: | |
title: Avoid the hill! | |
body: Turns out, it's really easy to fall down the hill and break your crown | |
author: jack | |
tags: hills, crown, tumbling | |
plumbing: | |
title: We need water supply | |
body: It's ridiculous we're still fetching water with a pail, we need plumbing | |
author: jill | |
tags: water, pails |
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
$ rake db:drop db:setup db:fixtures:load | |
Dropped database 'simple-example_development' | |
Dropped database 'simple-example_test' | |
Created database 'simple-example_development' | |
Created database 'simple-example_test' | |
-- enable_extension("plpgsql") | |
-> 0.0203s | |
-- create_table("authors", {:force=>:cascade}) | |
-> 0.0063s | |
-- create_table("posts", {:force=>:cascade}) | |
-> 0.0098s | |
-- create_table("posts_tags", {:force=>:cascade}) | |
-> 0.0083s | |
-- create_table("tags", {:force=>:cascade}) | |
-> 0.0062s | |
-- add_foreign_key("posts", "authors") | |
-> 0.0049s | |
-- add_foreign_key("posts_tags", "posts") | |
-> 0.0021s | |
-- add_foreign_key("posts_tags", "tags") | |
-> 0.0025s | |
-- add_foreign_key("tags", "authors") | |
-> 0.0014s | |
-- enable_extension("plpgsql") | |
-> 0.0229s | |
-- create_table("authors", {:force=>:cascade}) | |
-> 0.0050s | |
-- create_table("posts", {:force=>:cascade}) | |
-> 0.0088s | |
-- create_table("posts_tags", {:force=>:cascade}) | |
-> 0.0097s | |
-- create_table("tags", {:force=>:cascade}) | |
-> 0.0076s | |
-- add_foreign_key("posts", "authors") | |
-> 0.0030s | |
-- add_foreign_key("posts_tags", "posts") | |
-> 0.0018s | |
-- add_foreign_key("posts_tags", "tags") | |
-> 0.0017s | |
-- add_foreign_key("tags", "authors") | |
-> 0.0013s | |
rake aborted! | |
ActiveRecord::NotNullViolation: PG::NotNullViolation: ERROR: null value in column "created_at" violates not-null constraint | |
DETAIL: Failing row contains (1, 1050461717, 684148082, null, null). | |
: INSERT INTO "posts_tags" ("post_id", "tag_id") VALUES (1050461717, 684148082) | |
Caused by: | |
PG::NotNullViolation: ERROR: null value in column "created_at" violates not-null constraint | |
DETAIL: Failing row contains (1, 1050461717, 684148082, null, null). | |
Tasks: TOP => db:fixtures:load | |
(See full trace by running task with --trace) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment