Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lx 301 backsearch feedback backend #53

Merged
merged 7 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions migrations/2024011018230000-create-user-feedback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use strict";

module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.sequelize.query(
`CREATE TABLE user_feedback (
id bigint NOT NULL AUTO_INCREMENT,
question_use_case text,
question_impact text,
question_who_benefits text,
question_improvements text,
user_id bigint DEFAULT NULL,
submission_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
KEY user_id (user_id),
CONSTRAINT user_feedback_user FOREIGN KEY (user_id) REFERENCES user (id)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1`
);
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable("user_feedback");
},
};
21 changes: 21 additions & 0 deletions seeders/10_user_feedback.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"use strict";

const { faker } = require("@faker-js/faker");

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.bulkInsert("user_feedback", [
{
question_use_case: faker.lorem.paragraph(),
question_impact: faker.lorem.paragraph(),
question_who_benefits: faker.lorem.paragraph(),
question_improvements: faker.lorem.paragraph(),
feedback_user_id: 1,
},
]);
},

down: (queryInterface, Sequelize) => {
return queryInterface.bulkDelete("user_feedback", null, {});
},
};
Loading
Loading