// @ts-check

/**
 * @type {import("@moduletrace/nsqlite/dist/types").NSQLITE_DatabaseSchemaType}
 */
const schema = {
    tables: [
        {
            tableName: "users",
            fields: [
                {
                    fieldName: "first_name",
                    dataType: "TEXT",
                },
                {
                    fieldName: "last_name",
                    dataType: "TEXT",
                },
                {
                    fieldName: "email",
                    dataType: "TEXT",
                    unique: true,
                },
                {
                    fieldName: "username",
                    dataType: "TEXT",
                    unique: true,
                },
                {
                    fieldName: "image",
                    dataType: "TEXT",
                },
                {
                    fieldName: "password",
                    dataType: "TEXT",
                },
                {
                    fieldName: "is_super_admin",
                    dataType: "INTEGER",
                },
                {
                    fieldName: "all_deployment_access",
                    dataType: "INTEGER",
                },
            ],
        },
        {
            tableName: "users_ports",
            fields: [
                {
                    fieldName: "user_id",
                    dataType: "INTEGER",
                },
                {
                    fieldName: "port",
                    dataType: "INTEGER",
                    unique: true,
                },
            ],
        },
        {
            tableName: "users_allowed_services",
            fields: [
                {
                    fieldName: "user_id",
                    dataType: "INTEGER",
                },
                {
                    fieldName: "service_name",
                    dataType: "TEXT",
                },
            ],
        },
    ],
};

export default schema;
