Ajoute la migration initiale (migrations/0001_initial_schema.sql, incluant la table users nécessaire à l'adapter d'auth du ticket #48), le runner de migration (bin/migrate.dart) et l'accès Postgres (infrastructure/postgres/postgres_database.dart). dart pub get OK, dart analyze clean, dart test vert (le test PostgreSQL réel est skip faute de TEST_DATABASE_URL/Docker disponible dans ce sandbox ; SQL de migration revu manuellement). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
15 lines
408 B
Dart
15 lines
408 B
Dart
import 'package:gametime_server/infrastructure/postgres/postgres_database.dart';
|
|
|
|
Future<void> main(List<String> arguments) async {
|
|
final connection = await PostgresConnectionFactory(
|
|
PostgresConnectionConfig.fromEnvironment(),
|
|
).open();
|
|
|
|
try {
|
|
await PostgresMigrator(connection).applyMigrations();
|
|
print('PostgreSQL migrations applied.');
|
|
} finally {
|
|
await connection.close();
|
|
}
|
|
}
|