Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
doomy committed Oct 30, 2023
1 parent 6f7848c commit 938542e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion migrations/20230929015234_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ CREATE TABLE IF NOT EXISTS entries (
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
source_id INTEGER NOT NULL,

FOREIGN KEY(source_id) REFERENCES sources(id)
UNIQUE(traditional, simplified, pinyin_numbers) ON CONFLICT REPLACE,
FOREIGN KEY(source_id) REFERENCES sources(id) ON UPDATE CASCADE
);


Expand Down
5 changes: 1 addition & 4 deletions src-shared/src/models/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use crate::Id;
#[derive(Clone, serde::Deserialize, serde::Serialize, PartialEq)]
pub struct Entry {
pub id: Id,
#[cfg(target_arch = "wasm32")]
pub source_id: u32,
#[cfg(not(target_arch = "wasm32"))]
pub source_id: i64,
pub source_id: Id,
pub traditional: String,
pub simplified: String,
/// Pinyin with numbers
Expand Down

0 comments on commit 938542e

Please sign in to comment.