mirror of
https://github.com/aljazceru/ditto.git
synced 2026-02-23 14:06:58 +01:00
Drop users table
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
import { Conf } from '@/config.ts';
|
||||
import { db } from '@/db.ts';
|
||||
import { eventsDB } from '@/db/events.ts';
|
||||
import { type Kysely } from '@/deps.ts';
|
||||
import { signAdminEvent } from '@/sign.ts';
|
||||
|
||||
interface DB {
|
||||
users: {
|
||||
pubkey: string;
|
||||
username: string;
|
||||
inserted_at: Date;
|
||||
admin: 0 | 1;
|
||||
};
|
||||
}
|
||||
|
||||
switch (Deno.args[0]) {
|
||||
case 'users-to-events':
|
||||
await usersToEvents();
|
||||
@@ -14,7 +24,7 @@ switch (Deno.args[0]) {
|
||||
async function usersToEvents() {
|
||||
const { origin, host } = Conf.url;
|
||||
|
||||
for (const row of await db.selectFrom('users').selectAll().execute()) {
|
||||
for (const row of await (db as unknown as Kysely<DB>).selectFrom('users').selectAll().execute()) {
|
||||
const event = await signAdminEvent({
|
||||
kind: 30361,
|
||||
tags: [
|
||||
|
||||
Reference in New Issue
Block a user