slackapi / node-tasks-app

Tasks App is a sample Task Management app built on the Slack Platform.
MIT License
99 stars 50 forks source link

[BUG] Migrations not executing correctly #67

Closed mcsescott closed 3 years ago

mcsescott commented 3 years ago

Is there an existing issue for this?

Have you read our code of conduct?

Current Behavior

Getting an error trying to setup the tasks app.

Created a MySQL database called "vztaskmaster" from MySQL Attempted to run the database migration step according to the setup instructions... Got an error that needed to install mysql2, so then ran the command "npm install mysql2" Attempted the database migration command again, got the following error:

PS C:\Users\removed\Downloads\Slack Workflows\Applications\VZ Taskmaster> npx sequelize-cli db:migrate --url 'mysql://root:removed@localhost:3306/vztaskmaster'

Sequelize CLI [Node: 16.4.1, CLI: 6.2.0, ORM: 6.6.2]

Parsed url mysql://root:*****@localhost:3306/vztaskmaster
== 20210614114545-create-task: migrating =======
== 20210614114545-create-task: migrated (0.070s)

== 20210614115427-create-user: migrating =======
== 20210614115427-create-user: migrated (0.070s)

== 20210614140421-user-to-task-key: migrating =======

ERROR: Referencing column 'UserId' and referenced column 'id' in foreign key constraint 'Tasks_UserId_foreign_idx' are incompatible.

Expected Behavior

I was hoping that the app would start and run.

Steps To Reproduce

Just running through the setup.md documentation...

Environment

- OS: Win 10
- Language version: Node v16.4.1

Anything else?

Environment file:

SLACK_BOT_TOKEN=xoxb-removed SLACK_APP_TOKEN=xapp-removed DB_URI=mysql:root:removed@localhost:3306/vztaskmaster SAMPLE_DB_URI=sqlite:./database.sqlite3

colmdoyle commented 3 years ago

Weird. We develop the sample using SQLite, but use Sequelize to abstract any concerns about different underlying datastores. Let me do some testing with MySQL to try figure this out.

colmdoyle commented 3 years ago

@mcsescott - This is resolved now, thanks for your report!