fix varchar array

This commit is contained in:
Namekuji 2023-05-31 12:24:02 -04:00
parent 1455068e0c
commit 0bd5893e7d
No known key found for this signature in database
GPG Key ID: B541BD6E646CABC7
6 changed files with 15 additions and 15 deletions

View File

@ -17,7 +17,7 @@ pub struct Model {
#[sea_orm(column_name = "userListId")]
pub user_list_id: Option<String>,
#[sea_orm(column_type = "JsonBinary")]
pub keywords: newtype::Keyword,
pub keywords: newtype::JsonKeyword,
#[sea_orm(column_name = "withFile")]
pub with_file: bool,
pub expression: Option<String>,
@ -28,11 +28,11 @@ pub struct Model {
pub with_replies: bool,
#[sea_orm(column_name = "userGroupJoiningId")]
pub user_group_joining_id: Option<String>,
pub users: newtype::StringVec,
pub users: Vec<String>,
#[sea_orm(column_name = "excludeKeywords", column_type = "JsonBinary")]
pub exclude_keywords: newtype::Keyword,
pub exclude_keywords: newtype::JsonKeyword,
#[sea_orm(column_type = "JsonBinary")]
pub instances: newtype::StringVec,
pub instances: newtype::JsonStringVec,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View File

@ -8,10 +8,10 @@ use serde::{Deserialize, Serialize};
use crate::impl_json_newtype;
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, From)]
pub struct Keyword(pub Vec<Vec<String>>);
impl_json_newtype!(Keyword);
pub struct JsonKeyword(pub Vec<Vec<String>>);
impl_json_newtype!(JsonKeyword);
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema, From)]
pub struct StringVec(pub Vec<String>);
impl_json_newtype!(StringVec);
pub struct JsonStringVec(pub Vec<String>);
impl_json_newtype!(JsonStringVec);

View File

@ -13,14 +13,14 @@ pub struct Antenna {
pub id: String,
pub created_at: chrono::DateTime<chrono::Utc>,
pub name: String,
pub keywords: newtype::Keyword,
pub exclude_keywords: newtype::Keyword,
pub keywords: newtype::JsonKeyword,
pub exclude_keywords: newtype::JsonKeyword,
#[schema(inline)]
pub src: AntennaSrc,
pub user_list_id: Option<String>,
pub user_group_id: Option<String>,
pub users: newtype::StringVec,
pub instances: newtype::StringVec,
pub users: Vec<String>,
pub instances: newtype::JsonStringVec,
#[serde(default)]
pub case_sensitive: bool,
#[serde(default)]

View File

@ -88,7 +88,7 @@ async fn setup_model(db: &DatabaseConnection) {
.expect("Unable to setup predefined models");
}
mod it_test {
mod int_test {
use super::{cleanup, prepare};
#[tokio::test]

View File

@ -1,4 +1,4 @@
mod it_test {
mod int_test {
use model::{
entity::{antenna, user},
repository::Repository,

View File

@ -41,6 +41,6 @@
"universal": "napi universal",
"version": "napi version",
"cargo:unit": "cargo test --workspace unit_test",
"cargo:integration": "cargo test --workspace it_test -- --test-threads=1"
"cargo:integration": "cargo test --workspace int_test -- --test-threads=1"
}
}