feat(models): add new models for public API, event log, hook, session, user, and whatsapp account
* Introduced ModelPublicAPIKey, ModelPublicEventLog, ModelPublicHook, ModelPublicSession, ModelPublicUser, and ModelPublicWhatsappAccount * Removed deprecated ModelPublicUsers * Updated database schema definitions to reflect new model structure * Adjusted seed data to use correct types for timestamps
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// WhatsHooked Database Schema
|
||||
// This file defines the database schema for WhatsHooked Phase 2
|
||||
|
||||
Table users {
|
||||
Table user {
|
||||
id varchar(36) [primary key, note: 'UUID']
|
||||
username varchar(255) [unique, not null]
|
||||
email varchar(255) [unique, not null]
|
||||
@@ -18,7 +18,7 @@ Table users {
|
||||
}
|
||||
}
|
||||
|
||||
Table api_keys {
|
||||
Table api_key {
|
||||
id varchar(36) [primary key, note: 'UUID']
|
||||
user_id varchar(36) [not null, ref: > users.id]
|
||||
name varchar(255) [not null, note: 'Friendly name for the API key']
|
||||
@@ -38,7 +38,7 @@ Table api_keys {
|
||||
}
|
||||
}
|
||||
|
||||
Table hooks {
|
||||
Table hook {
|
||||
id varchar(36) [primary key, note: 'UUID']
|
||||
user_id varchar(36) [not null, ref: > users.id]
|
||||
name varchar(255) [not null]
|
||||
@@ -62,7 +62,7 @@ Table hooks {
|
||||
}
|
||||
}
|
||||
|
||||
Table whatsapp_accounts {
|
||||
Table whatsapp_account {
|
||||
id varchar(36) [primary key, note: 'UUID']
|
||||
user_id varchar(36) [not null, ref: > users.id]
|
||||
account_type varchar(50) [not null, note: 'whatsmeow or business-api']
|
||||
@@ -83,7 +83,7 @@ Table whatsapp_accounts {
|
||||
}
|
||||
}
|
||||
|
||||
Table event_logs {
|
||||
Table event_log {
|
||||
id varchar(36) [primary key, note: 'UUID']
|
||||
user_id varchar(36) [ref: > users.id, note: 'Optional user reference']
|
||||
event_type varchar(100) [not null]
|
||||
@@ -106,7 +106,7 @@ Table event_logs {
|
||||
}
|
||||
}
|
||||
|
||||
Table sessions {
|
||||
Table session {
|
||||
id varchar(36) [primary key, note: 'UUID']
|
||||
user_id varchar(36) [not null, ref: > users.id]
|
||||
token varchar(255) [unique, not null, note: 'Session token hash']
|
||||
|
||||
Reference in New Issue
Block a user