ctb_storage/migrations/m2026_06_30_2_create_nodes.rs
1// SPDX-License-Identifier: AGPL-3.0-or-later
2/*
3This file is part of Collective Toolbox, a database and document workspace and utilities.
4Copyright (C) 2026 Collective Toolbox Developers
5Contact: info@collectivetoolbox.com
6
7This program is free software: you can redistribute it and/or modify it under
8the terms of the GNU Affero General Public License as published by the Free
9Software Foundation, either version 3 of the License, or (at your option) any
10later version.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License along
17with this program. If not, see <https://www.gnu.org/licenses/>.
18*/
19
20//! Database migration creating graph node tables and relations.
21
22use crate::migrations::DbSchemaType;
23use crate::utilities::Result;
24use turso::Connection;
25
26pub const DB_TYPE: DbSchemaType = DbSchemaType::Nodes;
27pub const NAME: &str = "2026_06_01_1_create_nodes";
28pub const DESCRIPTION: &str = "Create initial nodes table";
29pub const UP_SQL: &str = "CREATE TABLE IF NOT EXISTS nodes (
30 id INTEGER PRIMARY KEY,
31 graph_id INTEGER NOT NULL,
32 type TEXT NOT NULL,
33 data BLOB NOT NULL
34)";
35
36pub async fn run_rust_migration(_conn: &Connection) -> Result<()> {
37 Ok(())
38}