feat: Add a large collection of emoji and other frontend assets, including a sound file, and a backend package.json.

This commit is contained in:
Bryan1029384756
2026-01-06 17:58:56 -06:00
parent f531301863
commit abedd78893
3795 changed files with 10981 additions and 229 deletions

View File

@@ -1,5 +1,6 @@
const fs = require('fs');
const path = require('path');
require('dotenv').config({ path: path.join(__dirname, '../.env') });
const db = require('../db');
async function initDb() {
@@ -7,18 +8,33 @@ async function initDb() {
const schemaPath = path.join(__dirname, '../schema.sql');
const schemaSql = fs.readFileSync(schemaPath, 'utf8');
console.log('Dropping existing tables...');
await db.query(`
DROP TABLE IF EXISTS invites CASCADE;
DROP TABLE IF EXISTS messages CASCADE;
DROP TABLE IF EXISTS channel_keys CASCADE;
DROP TABLE IF EXISTS roles CASCADE;
DROP TABLE IF EXISTS channels CASCADE;
DROP TABLE IF EXISTS users CASCADE;
`);
console.log('Applying schema...');
await db.query(schemaSql);
// Seed Channels
const channels = ['general', 'random'];
for (const name of channels) {
await db.query(
`INSERT INTO channels (name) VALUES ($1) ON CONFLICT (name) DO NOTHING`,
[name]
);
}
console.log('Channels seeded.');
console.log('Schema applied successfully.');
console.log('Seeding Default Roles...');
// 1. @everyone (Limited)
await db.query(`
INSERT INTO roles (name, color, position, is_hoist, permissions)
VALUES ('@everyone', '#99aab5', 0, false, '{"manage_channels": false, "manage_roles": false, "create_invite": false, "embed_links": true, "attach_files": true}')
`);
// 2. Owner (All Permissions)
await db.query(`
INSERT INTO roles (name, color, position, is_hoist, permissions)
VALUES ('Owner', '#ED4245', 100, true, '{"manage_channels": true, "manage_roles": true, "create_invite": true, "embed_links": true, "attach_files": true}')
`);
console.log('Schema applied successfully.');
process.exit(0);