···11+CREATE TABLE IF NOT EXISTS profiles (
22+ did TEXT PRIMARY KEY,
33+ created_at TIMESTAMP,
44+ updated_at TIMESTAMP
55+);
+9
scripts/init.cql
···11+-- Create keyspace if it doesn't exist
22+CREATE KEYSPACE IF NOT EXISTS vylet
33+WITH replication = {
44+ 'class': 'SimpleStrategy',
55+ 'replication_factor': 1
66+};
77+88+-- Use the keyspace
99+USE vylet;
+30
scripts/setup-cassandra.sh
···11+#!/bin/bash
22+33+echo "Waiting for Cassandra to be ready..."
44+max_attempts=30
55+attempt=0
66+77+while [ $attempt -lt $max_attempts ]; do
88+ if docker exec cassandra cqlsh -e "describe cluster" > /dev/null 2>&1; then
99+ echo "Cassandra is ready!"
1010+ break
1111+ fi
1212+ attempt=$((attempt + 1))
1313+ echo "Attempt $attempt/$max_attempts - Cassandra not ready yet..."
1414+ sleep 2
1515+done
1616+1717+if [ $attempt -eq $max_attempts ]; then
1818+ echo "Cassandra failed to start within expected time"
1919+ exit 1
2020+fi
2121+2222+echo "Running initialization script..."
2323+docker exec -i cassandra cqlsh < scripts/init.cql
2424+2525+echo "Cassandra setup complete!"
2626+echo ""
2727+echo "You can verify with:"
2828+echo " docker exec -it cassandra cqlsh"
2929+echo " USE vylet;"
3030+echo " DESCRIBE TABLES;"