작성
·
381
·
수정됨
0
AND
`TABLE_NAME` = 'channels'
UNION
SELECT
*
FROM `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS`
WHERE
`CONSTRAINT_SCHEMA` = 'sleact'
AND
`TABLE_NAME` = 'channelchats'
UNION
SELECT
*
FROM `INFORMATION_SCHEMA`.`REFERENTIAL_CONSTRAINTS`
WHERE
`CONSTRAINT_SCHEMA` = 'sleact'
AND
`TABLE_NAME` = 'users'
) `rc`
ON
`rc`.`CONSTRAINT_SCHEMA` = `kcu`.`CONSTRAINT_SCHEMA`
AND
`rc`.`TABLE_NAME` = `kcu`.`TABLE_NAME`
AND
`rc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME`
query: SELECT VERSION() AS `version`
query: SELECT * FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA` = 'sleact' AND `TABLE_NAME` = 'typeorm_metadata'
query: DROP INDEX `UserId` ON `workspacemembers`
query failed: DROP INDEX `UserId` ON `workspacemembers`
error: Error: Cannot drop index 'UserId': needed in a foreign key constraint
query: ROLLBACK
[Nest] 81848 - 2023. 09. 20. 오전 12:47:04 ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)...
QueryFailedError: Cannot drop index 'UserId': needed in a foreign key constraint
at Query.onResult (/Users/yujinseung/Desktop/Slack/slack_s/src/driver/mysql/MysqlQueryRunner.ts:222:33)
at Query.execute (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/commands/command.js:36:14)
at PoolConnection.handlePacket (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/connection.js:478:34)
at PacketParser.onPacket (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/connection.js:97:12)
at PacketParser.executeStart (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/connection.js:104:25)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Socket.Readable.push (node:internal/streams/readable:234:10)
[Nest] 81848 - 2023. 09. 20. 오전 12:47:04 ERROR [ExceptionHandler] Cannot drop index 'UserId': needed in a foreign key constraint
QueryFailedError: Cannot drop index 'UserId': needed in a foreign key constraint
at Query.onResult (/Users/yujinseung/Desktop/Slack/slack_s/src/driver/mysql/MysqlQueryRunner.ts:222:33)
at Query.execute (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/commands/command.js:36:14)
at PoolConnection.handlePacket (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/connection.js:478:34)
at PacketParser.onPacket (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/connection.js:97:12)
at PacketParser.executeStart (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/mysql2/lib/connection.js:104:25)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Socket.Readable.push (node:internal/streams/readable:234:10)
이런오류가 뜹니다..! 뭐가 문제인지 모르겠습니당..
https://github.com/jinseung0327/slack_clone
혹시나 해서 깃허브 주소까지 올립니닷..!
답변 2
0
아 넵..!!
[Nest] 44738 - 2023. 09. 19. 오후 11:38:53 ERROR [ExceptionHandler] Nest can't resolve dependencies of the UsersRepository (?). Please make sure that the argument DataSource at index [0] is available in the TypeOrmModule context.
Potential solutions:
- Is TypeOrmModule a valid NestJS module?
- If DataSource is a provider, is it part of the current TypeOrmModule?
- If DataSource is exported from a separate @Module, is that module imported within TypeOrmModule?
@Module({
imports: [ /* the Module containing DataSource */ ]
})
Error: Nest can't resolve dependencies of the UsersRepository (?). Please make sure that the argument DataSource at index [0] is available in the TypeOrmModule context.
Potential solutions:
- Is TypeOrmModule a valid NestJS module?
- If DataSource is a provider, is it part of the current TypeOrmModule?
- If DataSource is exported from a separate @Module, is that module imported within TypeOrmModule?
@Module({
imports: [ /* the Module containing DataSource */ ]
})
at Injector.lookupComponentInParentModules (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/injector.js:254:19)
at Injector.resolveComponentInstance (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/injector.js:207:33)
at resolveParam (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/injector.js:128:38)
at async Promise.all (index 0)
at Injector.resolveConstructorParams (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/injector.js:143:27)
at Injector.loadInstance (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/injector.js:70:13)
at Injector.loadProvider (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/injector.js:97:9)
at /Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/instance-loader.js:56:13
at async Promise.all (index 3)
at InstanceLoader.createInstancesOfProviders (/Users/yujinseung/Desktop/Slack/slack_s/node_modules/@nestjs/core/injector/instance-loader.js:55:9)
appmodule.ts에 안한게있어서 넣고 했는데 위에 수정한 저 오류가 뜹니다..!