feat: backend core - auth, user, role, permission, device, webhook, monitoring, cache, repository, service, middleware, API handlers
This commit is contained in:
19
migrations/003_add_social_accounts.sql
Normal file
19
migrations/003_add_social_accounts.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS user_social_accounts (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
user_id BIGINT NOT NULL,
|
||||
provider VARCHAR(50) NOT NULL,
|
||||
open_id VARCHAR(100) NOT NULL,
|
||||
union_id VARCHAR(100) NULL,
|
||||
nickname VARCHAR(100) NULL,
|
||||
avatar VARCHAR(500) NULL,
|
||||
gender VARCHAR(10) NULL,
|
||||
email VARCHAR(100) NULL,
|
||||
phone VARCHAR(20) NULL,
|
||||
extra JSON NULL,
|
||||
status INT NOT NULL DEFAULT 1,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY uk_provider_open_id (provider, open_id),
|
||||
KEY idx_social_accounts_user_id (user_id),
|
||||
CONSTRAINT fk_social_accounts_user FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user