mirror of
https://github.com/atuinsh/atuin.git
synced 2025-08-13 17:07:26 +02:00
Add record migration
This commit is contained in:
5
atuin-server-postgres/build.rs
Normal file
5
atuin-server-postgres/build.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// generated by `sqlx migrate build-script`
|
||||||
|
fn main() {
|
||||||
|
// trigger recompilation when a new migration is added
|
||||||
|
println!("cargo:rerun-if-changed=migrations");
|
||||||
|
}
|
13
atuin-server-postgres/migrations/20230623070418_records.sql
Normal file
13
atuin-server-postgres/migrations/20230623070418_records.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
-- Add migration script here
|
||||||
|
create table records (
|
||||||
|
id uuid primary key, -- remember to use uuidv7 for happy indices <3
|
||||||
|
host uuid not null, -- a unique identifier for the host
|
||||||
|
parent uuid not null, -- the ID of the parent record, bearing in mind this is a linked list
|
||||||
|
timestamp bigint not null, -- not a timestamp type, as those do not have nanosecond precision
|
||||||
|
version text not null,
|
||||||
|
tag text not null, -- what is this? history, kv, whatever. Remember clients get a log per tag per host
|
||||||
|
data bytea not null, -- store the actual history data, encrypted. I don't wanna know!
|
||||||
|
|
||||||
|
user_id bigint not null, -- allow multiple users
|
||||||
|
created_at timestamp not null default current_timestamp
|
||||||
|
);
|
Reference in New Issue
Block a user