fix: store refresh-at as string type, not date type, for sqlx autotyping

This commit is contained in:
Robert Perce 2026-02-04 13:32:03 -06:00
parent c7130bbcd4
commit 4a0ed99329
2 changed files with 31 additions and 10 deletions

View file

@ -0,0 +1,19 @@
PRAGMA foreign_keys=OFF;
create table if not exists new_contacts (
id integer primary key autoincrement,
birthday text,
manually_freshened_at text,
text_body text,
lives_with text not null default ''
);
insert into new_contacts (
id, birthday, manually_freshened_at, text_body, lives_with)
select id, birthday, manually_freshened_at, text_body, lives_with
from contacts;
drop table contacts;
alter table new_contacts rename to contacts;
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;

View file

@ -601,16 +601,18 @@ mod put {
.execute(pool) .execute(pool)
.await?; .await?;
QueryBuilder::new("insert into groups (contact_id, name, slug) ") if new_groups.len() > 0 {
.push_values(&new_groups, |mut b, name| { QueryBuilder::new("insert into groups (contact_id, name, slug) ")
b.push_bind(contact_id) .push_values(&new_groups, |mut b, name| {
.push_bind(name) b.push_bind(contact_id)
.push_bind(slugify(name)); .push_bind(name)
}) .push_bind(slugify(name));
.build() })
.persistent(false) .build()
.execute(pool) .persistent(false)
.await?; .execute(pool)
.await?;
}
{ {
let mut switchboard = sw_lock.write().unwrap(); let mut switchboard = sw_lock.write().unwrap();