Closed jaykayudo closed 4 weeks ago
This pull request introduces four new migration files for creating database tables using Sequelize: banners
, popup_logs
, tours
, and hints
. Each migration defines the structure of its respective table, including various columns with specific data types, constraints, and default values. The up
methods establish the schema, while the down
methods provide the ability to drop the tables if necessary. Indexes are also added in some migrations to enhance query performance.
File Path | Change Summary |
---|---|
backend/migrations/20241022153237-create-banners-table.js |
Added migration for banners table with columns: id , closeButtonAction , position , url , fontColor , backgroundColor , bannerText , createdBy . |
backend/migrations/20241022170915-create-popup_logs-table.js |
Added migration for popup_logs table with columns: id , popupType , userId , showingTime , completed , including indexes on userId and popupType . |
backend/migrations/20241022190720-create-tours-table.js |
Added migration for tours table with columns: id , title , description , statusActive , pageTargeting , theme , triggeringFrequency , createdBy , including indexes. |
backend/migrations/20241022191246-create-hints-table.js |
Added migration for hints table with columns: id , action , actionButtonUrl , actionButtonText , targetElement , tooltipPlacement , hintContent , header , color fields, createdBy , including indexes. |
Objective | Addressed | Explanation |
---|---|---|
Create migrations for Banners, PopupLog, Hints, and Tours (309) | ✅ |
Are the migrations any different from the models? The question is, will we encounter different behavior when running migrations versus using sequelize.sync()
Are the migrations any different from the models? The question is, will we encounter different behavior when running migrations versus using
sequelize.sync()
No it wouldn't as the migrations create new table and does not any update other tables and is not being referenced by any other table. And the migrations is created based on the specifics of the models so they should not encounter different behaviours. You can also check the file changes to verify.
@erenfn does this PR meet the requirements of the task?
Yes, but do not add checks that are not in the models.
You also have to include other vallidations. For example:
validate: {
isValidAction(value) {
validateActionButton(value);
},
},
These should be in the migrations
You also have to include other vallidations. For example:
validate: { isValidAction(value) { validateActionButton(value); }, },
These should be in the migrations
@erenfn Done
Did you push the changes? you just have to change created-by to createdBy
Did you push the changes? you just have to change created-by to createdBy
Sorry about that. I mistakely removed it while i was testing.
Resolves https://github.com/bluewave-labs/bluewave-onboarding/issues/309