我在“问题调查”中将值推送到我的数据库时遇到问题。领域。我能够控制日志记录字符串值。所有其他字段都按预期工作。 继承人'表:
CREATE TABLE questions
(qquestion_id SERIAL PRIMARY KEY,
qdate_added timestamp default now(),
question TEXT,
quser_id int REFERENCES users(user_id),
qtopic_id int REFERENCES subjects(subject_id) ON DELETE CASCADE,
question_sub TEXT
);
Axios帖子:
axios.post(url, {
question: newQuestion,
qtopic_id: id,
question_sub: sub
})
这是在新帖子上返回我的数据库的内容:
{
qquestion_id: 10,
qdate_added: "2017-05-28T21:28:55.593Z",
question: "Hows react work with node?",
quser_id: null,
qtopic_id: 3,
question_sub: null
}
我也在字段中尝试了NOT NULL,但后来我无法发布到数据库。感谢任何帮助!