PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE openmls_sqlite_storage_migrations(
             version int4 PRIMARY KEY,
             name VARCHAR(255),
             applied_on VARCHAR(255),
             checksum VARCHAR(255));
INSERT INTO openmls_sqlite_storage_migrations VALUES(1,'initial','2026-03-10T10:34:47.515202328Z','5121145794404019609');
INSERT INTO openmls_sqlite_storage_migrations VALUES(2,'constraint_addition','2026-03-10T10:34:47.51527263Z','366327680295175235');
CREATE TABLE openmls_encryption_keys (
    provider_version INTEGER NOT NULL,
    public_key BLOB PRIMARY KEY,
    key_pair BLOB NOT NULL
);
CREATE TABLE openmls_epoch_keys_pairs (
    provider_version INTEGER NOT NULL,
    group_id BLOB NOT NULL,
    epoch_id BLOB NOT NULL,
    leaf_index INTEGER NOT NULL,
    key_pairs BLOB NOT NULL,
    PRIMARY KEY (group_id, epoch_id, leaf_index)
);
INSERT INTO openmls_epoch_keys_pairs VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d',X'39',0,X'[BLOB]');
CREATE TABLE openmls_key_packages (
    provider_version INTEGER NOT NULL,
    key_package_ref BLOB PRIMARY KEY,
    key_package BLOB NOT NULL
);
CREATE TABLE openmls_own_leaf_nodes (
    provider_version INTEGER NOT NULL,
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    group_id BLOB NOT NULL,
    leaf_node BLOB NOT NULL
);
CREATE TABLE openmls_proposals (
    provider_version INTEGER NOT NULL,
    group_id BLOB NOT NULL,
    proposal_ref BLOB NOT NULL,
    proposal BLOB NOT NULL,
    PRIMARY KEY (group_id, proposal_ref)
);
CREATE TABLE openmls_signature_keys (
    provider_version INTEGER NOT NULL,
    public_key BLOB PRIMARY KEY,
    signature_key BLOB NOT NULL
);
INSERT INTO openmls_signature_keys VALUES(1,X'[BLOB]',X'[BLOB]');
CREATE TABLE IF NOT EXISTS "openmls_group_data" (
    provider_version INTEGER NOT NULL,
    group_id BLOB NOT NULL,
    data_type TEXT NOT NULL CHECK (data_type IN (
        'join_group_config', 
        'tree', 
        'interim_transcript_hash',
        'context', 
        'confirmation_tag', 
        'group_state', 
        'message_secrets', 
        'resumption_psk_store',
        'own_leaf_index',
        'use_ratchet_tree_extension',
        'group_epoch_secrets',
        'application_export_tree'
    )),
    group_data BLOB NOT NULL,
    PRIMARY KEY (group_id, data_type)
);
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','own_leaf_index',X'30');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','join_group_config',X'[BLOB]');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','group_state',X'224f7065726174696f6e616c22');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','tree',X'[BLOB]');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','confirmation_tag',X'[BLOB]');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','context',X'[BLOB]');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','interim_transcript_hash',X'5b38342c3134342c3231322c32382c3131392c3234362c34332c33382c3232362c372c3135302c31352c3138372c35382c302c36302c33302c3130322c3230312c35342c3134392c362c3136312c3132342c3136382c3132342c3233372c3139392c3138352c32302c352c3134305d');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','group_epoch_secrets',X'[BLOB]');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','message_secrets',X'[BLOB]');
INSERT INTO openmls_group_data VALUES(1,X'7b2276616c7565223a7b22766563223a5b3131362c3130312c3131352c3131362c39352c3130332c3131342c3131312c3131372c3131322c39352c3130352c3130305d7d7d','resumption_psk_store',X'[BLOB]');
DELETE FROM sqlite_sequence;
COMMIT;

