133 lines
4.6 KiB
JavaScript
133 lines
4.6 KiB
JavaScript
const { sequelize, connectDB } = require('./config/database');
|
|
const Block = require('./models/Block');
|
|
|
|
const eventBlocks = [
|
|
{
|
|
name: 'Stuhl (Standard)',
|
|
category: 'Bestuhlung',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 40 40">
|
|
<rect x="5" y="5" width="30" height="30" rx="2" fill="#4a90d9" stroke="#2c5f8a" stroke-width="2"/>
|
|
<rect x="10" y="28" width="20" height="4" rx="1" fill="#d4e6f1"/>
|
|
<circle cx="20" cy="18" r="8" fill="#d4e6f1" stroke="#2c5f8a" stroke-width="1.5"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Tisch (Rechteck 180x80)',
|
|
category: 'Möbel',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 180 80">
|
|
<rect x="0" y="0" width="180" height="80" rx="4" fill="#e8d5b7" stroke="#8b7355" stroke-width="2"/>
|
|
<rect x="5" y="5" width="170" height="70" rx="2" fill="#f5ead0" stroke="#c4a882" stroke-width="1"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Tisch (Rund Ø120)',
|
|
category: 'Möbel',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 120 120">
|
|
<circle cx="60" cy="60" r="58" fill="#e8d5b7" stroke="#8b7355" stroke-width="2"/>
|
|
<circle cx="60" cy="60" r="50" fill="#f5ead0" stroke="#c4a882" stroke-width="1"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Bühne (Modular 200x100)',
|
|
category: 'Bühne',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 200 100">
|
|
<rect x="0" y="0" width="200" height="100" fill="#8b7355" stroke="#6b5335" stroke-width="2"/>
|
|
<line x1="0" y1="25" x2="200" y2="25" stroke="#a08060" stroke-width="1"/>
|
|
<line x1="0" y1="50" x2="200" y2="50" stroke="#a08060" stroke-width="1"/>
|
|
<line x1="0" y1="75" x2="200" y2="75" stroke="#a08060" stroke-width="1"/>
|
|
<line x1="50" y1="0" x2="50" y2="100" stroke="#a08060" stroke-width="1"/>
|
|
<line x1="100" y1="0" x2="100" y2="100" stroke="#a08060" stroke-width="1"/>
|
|
<line x1="150" y1="0" x2="150" y2="100" stroke="#a08060" stroke-width="1"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Stehtisch',
|
|
category: 'Möbel',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 60 60">
|
|
<circle cx="30" cy="30" r="28" fill="#e8d5b7" stroke="#8b7355" stroke-width="2"/>
|
|
<circle cx="30" cy="30" r="24" fill="#f5ead0" stroke="#c4a882" stroke-width="1"/>
|
|
<circle cx="30" cy="30" r="5" fill="#8b7355"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Barhocker',
|
|
category: 'Bestuhlung',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 30 30">
|
|
<circle cx="15" cy="12" r="10" fill="#4a90d9" stroke="#2c5f8a" stroke-width="2"/>
|
|
<rect x="12" y="20" width="6" height="8" fill="#7f8c8d"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Mischpult',
|
|
category: 'Technik',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 120 60">
|
|
<rect x="0" y="0" width="120" height="60" rx="3" fill="#2c3e50" stroke="#1a252f" stroke-width="2"/>
|
|
<rect x="5" y="5" width="110" height="15" fill="#34495e" stroke="#2c3e50" stroke-width="1"/>
|
|
<circle cx="20" cy="40" r="5" fill="#e74c3c"/>
|
|
<circle cx="40" cy="40" r="5" fill="#e67e22"/>
|
|
<circle cx="60" cy="40" r="5" fill="#f1c40f"/>
|
|
<circle cx="80" cy="40" r="5" fill="#3498db"/>
|
|
<circle cx="100" cy="40" r="5" fill="#2ecc71"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Lautsprecher',
|
|
category: 'Technik',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 40 60">
|
|
<rect x="0" y="0" width="40" height="60" rx="3" fill="#34495e" stroke="#1a252f" stroke-width="2"/>
|
|
<rect x="8" y="8" width="24" height="25" rx="12" fill="#1a252f"/>
|
|
<circle cx="20" cy="20" r="6" fill="#7f8c8d"/>
|
|
<rect x="8" y="40" width="24" height="5" rx="2" fill="#1a252f"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Trennwand',
|
|
category: 'Raum',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 10 100">
|
|
<rect x="0" y="0" width="10" height="100" fill="#bdc3c7" stroke="#7f8c8d" stroke-width="1"/>
|
|
<line x1="2" y1="0" x2="2" y2="100" stroke="#95a5a6" stroke-width="0.5"/>
|
|
<line x1="5" y1="0" x2="5" y2="100" stroke="#95a5a6" stroke-width="0.5"/>
|
|
<line x1="8" y1="0" x2="8" y2="100" stroke="#95a5a6" stroke-width="0.5"/>
|
|
</svg>`
|
|
},
|
|
{
|
|
name: 'Notausgang-Schild',
|
|
category: 'Sicherheit',
|
|
is_public: true,
|
|
svg_data: `<svg viewBox="0 0 40 20">
|
|
<rect x="0" y="0" width="40" height="20" rx="2" fill="#27ae60" stroke="#1e8449" stroke-width="1"/>
|
|
<polygon points="8,5 3,10 8,15 7,15 2,10 7,5" fill="white"/>
|
|
<text x="20" y="15" font-size="8" fill="white" text-anchor="middle" font-family="Arial">EXIT</text>
|
|
</svg>`
|
|
},
|
|
];
|
|
|
|
async function seed() {
|
|
try {
|
|
await connectDB();
|
|
// Clear existing blocks
|
|
await Block.destroy({ where: {} });
|
|
console.log('Existing blocks cleared.');
|
|
// Insert new blocks
|
|
for (const block of eventBlocks) {
|
|
await Block.create(block);
|
|
}
|
|
console.log(`${eventBlocks.length} blocks created successfully.`);
|
|
process.exit(0);
|
|
} catch (err) {
|
|
console.error('Seed failed:', err);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
seed();
|