feat: remove supabase
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Snippet } from '@/models-supa/snippet.ts';
|
||||
import { Snippet } from '@/routes/snippet/snippet.ts';
|
||||
import { app } from '@/app.ts';
|
||||
|
||||
app
|
||||
|
||||
54
src/routes/snippet/snippet.ts
Normal file
54
src/routes/snippet/snippet.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { sequelize } from '@/modules/sequelize.ts';
|
||||
import { DataTypes, Model } from 'sequelize';
|
||||
|
||||
export class Snippet extends Model {
|
||||
declare id: string;
|
||||
declare title: string;
|
||||
declare description: string;
|
||||
declare snippet: string;
|
||||
declare keyword: string;
|
||||
declare user_id: string;
|
||||
declare data: any;
|
||||
}
|
||||
|
||||
Snippet.init(
|
||||
{
|
||||
id: {
|
||||
type: DataTypes.UUID,
|
||||
primaryKey: true,
|
||||
defaultValue: DataTypes.UUIDV4,
|
||||
},
|
||||
title: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true,
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true,
|
||||
},
|
||||
snippet: {
|
||||
type: DataTypes.TEXT,
|
||||
allowNull: true,
|
||||
},
|
||||
keyword: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
user_id: {
|
||||
type: DataTypes.UUID,
|
||||
},
|
||||
data: {
|
||||
type: DataTypes.JSONB,
|
||||
allowNull: true,
|
||||
defaultValue: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
tableName: 'snippet',
|
||||
paranoid: true,
|
||||
},
|
||||
);
|
||||
// 当
|
||||
// Snippet.sync({ alter: true, logging: false }).catch((e) => {
|
||||
// console.error('Snippet sync error', e);
|
||||
// });
|
||||
Reference in New Issue
Block a user