Rename database tables to use plural names

This commit is contained in:
Manuel Vögele
2024-01-22 16:45:21 +01:00
parent 97ca239ee1
commit d338f89a15
6 changed files with 42 additions and 35 deletions

View File

@@ -5,10 +5,10 @@ use diesel::{
};
use crate::appointment::Appointment;
use crate::schema::{chat, reminder};
use crate::schema::{chats, reminders};
#[derive(Queryable, Selectable, Identifiable)]
#[diesel(table_name = chat)]
#[diesel(table_name = chats)]
pub struct DbChat {
id: i32,
telegram_id: i64,
@@ -22,7 +22,7 @@ pub struct DbChat {
#[derive(Queryable, Selectable, Identifiable, Associations)]
#[diesel(belongs_to(DbChat, foreign_key=chat_id))]
#[diesel(table_name = reminder)]
#[diesel(table_name = reminders)]
pub struct DbReminder {
id: i32,
chat_id: i32,