Skip to main content

Migration

Struct Migration 

Source
pub struct Migration;

Implementations§

Source§

impl Migration

Source

pub const SCHEMA: &'static str = "-- BoardDown SQLite Schema\n-- Version: 1\n\n-- Boards table\nCREATE TABLE IF NOT EXISTS boards (\n id TEXT PRIMARY KEY,\n title TEXT NOT NULL,\n metadata TEXT, -- JSON\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL\n);\n\n-- Columns table\nCREATE TABLE IF NOT EXISTS columns (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n board_id TEXT NOT NULL,\n name TEXT NOT NULL,\n \"order\" INTEGER NOT NULL DEFAULT 0,\n wip_limit INTEGER,\n FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE,\n UNIQUE(board_id, name)\n);\n\n-- Tasks table\nCREATE TABLE IF NOT EXISTS tasks (\n id TEXT PRIMARY KEY,\n board_id TEXT NOT NULL,\n title TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT \'todo\',\n column_name TEXT NOT NULL,\n metadata TEXT, -- JSON\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE\n);\n\n-- Dependencies table\nCREATE TABLE IF NOT EXISTS dependencies (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n from_task_id TEXT NOT NULL,\n to_task_id TEXT NOT NULL,\n dependency_type TEXT NOT NULL DEFAULT \'depends_on\',\n FOREIGN KEY (from_task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n FOREIGN KEY (to_task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n UNIQUE(from_task_id, to_task_id)\n);\n\n-- Change log for sync\nCREATE TABLE IF NOT EXISTS change_log (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n board_id TEXT NOT NULL,\n version INTEGER NOT NULL,\n operation TEXT NOT NULL, -- JSON\n timestamp TEXT NOT NULL,\n FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE\n);\n\n-- Full-text search index\nCREATE VIRTUAL TABLE IF NOT EXISTS tasks_fts USING fts5(\n task_id,\n board_id,\n title,\n content,\n metadata,\n tokenize = \'porter unicode61\'\n);\n\n-- Indexes for common queries\nCREATE INDEX IF NOT EXISTS idx_tasks_board_id ON tasks(board_id);\nCREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status);\nCREATE INDEX IF NOT EXISTS idx_tasks_column ON tasks(column_name);\nCREATE INDEX IF NOT EXISTS idx_change_log_version ON change_log(board_id, version);\n"

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more