From 595b4e730ec4f13cd13e8548e572fe10716499c3 Mon Sep 17 00:00:00 2001 From: tk Date: Sun, 17 Aug 2025 00:33:44 +0200 Subject: [PATCH] resolved protocol resolution issue --- .../lib/src/protocol/client.dart | 73 +- .../protocol/{quotes => }/create_quote.dart | 0 .../lib/src/protocol/health.dart | 96 + .../lib/src/protocol/protocol.dart | 85 +- .../lib/src/protocol/{quotes => }/quote.dart | 0 .../lib/src/protocol/{votes => }/vote.dart | 22 +- .../lib/src/protocol/votes/vote_request.dart | 108 - .../lib/helper/go_router.dart | 2 +- wien_talks/wien_talks_server/lib/server.dart | 16 +- .../generated/{quotes => }/create_quote.dart | 0 .../lib/src/generated/endpoints.dart | 111 +- .../{votes/vote_request.dart => health.dart} | 273 ++- .../lib/src/generated/protocol.dart | 189 +- .../lib/src/generated/protocol.yaml | 7 +- .../lib/src/generated/{quotes => }/quote.dart | 0 .../lib/src/generated/{votes => }/vote.dart | 32 +- .../lib/src/health/health-endpoint.dart | 23 + .../{quotes => models}/create_quote.spy.yaml | 0 .../lib/src/models/health.spy.yaml | 5 + .../lib/src/{quotes => models}/quote.spy.yaml | 0 .../lib/src/{votes => models}/vote.spy.yaml | 2 +- .../lib/src/quotes/quotes_endpoint.dart | 11 +- .../lib/src/votes/vote_request.spy.yaml | 6 - .../lib/src/votes/votes_endpoint.dart | 35 +- .../20250816095813247/definition_project.json | 11 - .../20250816122625449/migration.json | 676 ------ .../20250816122625449/migration.sql | 158 -- .../20250816212658542/definition.json | 1855 ++++++++++++++++ .../20250816212658542/definition.sql | 405 ++++ .../20250816212658542/definition_project.json | 162 ++ .../migration.json | 728 +++++++ .../migration.sql | 152 +- .../20250816212959541/definition.json | 1855 ++++++++++++++++ .../20250816212959541/definition.sql | 405 ++++ .../20250816212959541/definition_project.json | 162 ++ .../migration.json | 0 .../migration.sql | 4 +- .../definition.json | 51 +- .../definition.sql | 14 +- .../definition_project.json | 49 + .../20250816214717668/migration.json | 43 + .../20250816214717668/migration.sql | 33 + .../definition.json | 51 +- .../definition.sql | 14 +- .../definition_project.json | 49 + .../20250816215043551/migration.json | 5 + .../20250816215043551/migration.sql | 29 + .../definition.json | 698 +++++- .../definition.sql | 151 +- .../20250816215049795/definition_project.json | 156 ++ .../20250816215049795/migration.json | 5 + .../20250816215049795/migration.sql | 29 + .../20250816215102447/definition.json | 1849 ++++++++++++++++ .../20250816215102447/definition.sql | 404 ++++ .../20250816215102447/definition_project.json | 156 ++ .../20250816215102447/migration.json | 5 + .../20250816215102447/migration.sql | 29 + .../20250816220051483/definition.json | 1898 +++++++++++++++++ .../20250816220051483/definition.sql | 414 ++++ .../20250816220051483/definition_project.json | 205 ++ .../20250816220051483/migration.json | 124 ++ .../20250816220051483/migration.sql | 54 + .../migrations/migration_registry.txt | 10 +- .../test_tools/serverpod_test_tools.dart | 205 +- 64 files changed, 12995 insertions(+), 1404 deletions(-) rename wien_talks/wien_talks_client/lib/src/protocol/{quotes => }/create_quote.dart (100%) create mode 100644 wien_talks/wien_talks_client/lib/src/protocol/health.dart rename wien_talks/wien_talks_client/lib/src/protocol/{quotes => }/quote.dart (100%) rename wien_talks/wien_talks_client/lib/src/protocol/{votes => }/vote.dart (87%) delete mode 100644 wien_talks/wien_talks_client/lib/src/protocol/votes/vote_request.dart rename wien_talks/wien_talks_server/lib/src/generated/{quotes => }/create_quote.dart (100%) rename wien_talks/wien_talks_server/lib/src/generated/{votes/vote_request.dart => health.dart} (50%) rename wien_talks/wien_talks_server/lib/src/generated/{quotes => }/quote.dart (100%) rename wien_talks/wien_talks_server/lib/src/generated/{votes => }/vote.dart (95%) create mode 100644 wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart rename wien_talks/wien_talks_server/lib/src/{quotes => models}/create_quote.spy.yaml (100%) create mode 100644 wien_talks/wien_talks_server/lib/src/models/health.spy.yaml rename wien_talks/wien_talks_server/lib/src/{quotes => models}/quote.spy.yaml (100%) rename wien_talks/wien_talks_server/lib/src/{votes => models}/vote.spy.yaml (84%) delete mode 100644 wien_talks/wien_talks_server/lib/src/votes/vote_request.spy.yaml delete mode 100644 wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json delete mode 100644 wien_talks/wien_talks_server/migrations/20250816122625449/migration.json delete mode 100644 wien_talks/wien_talks_server/migrations/20250816122625449/migration.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816212658542/definition.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json rename wien_talks/wien_talks_server/migrations/{20250816095813247 => 20250816212658542}/migration.json (62%) rename wien_talks/wien_talks_server/migrations/{20250816095813247 => 20250816212658542}/migration.sql (63%) create mode 100644 wien_talks/wien_talks_server/migrations/20250816212959541/definition.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json rename wien_talks/wien_talks_server/migrations/{20250816171653001 => 20250816212959541}/migration.json (100%) rename wien_talks/wien_talks_server/migrations/{20250816171653001 => 20250816212959541}/migration.sql (85%) rename wien_talks/wien_talks_server/migrations/{20250816122625449 => 20250816214717668}/definition.json (97%) rename wien_talks/wien_talks_server/migrations/{20250816171653001 => 20250816214717668}/definition.sql (97%) rename wien_talks/wien_talks_server/migrations/{20250816122625449 => 20250816214717668}/definition_project.json (68%) create mode 100644 wien_talks/wien_talks_server/migrations/20250816214717668/migration.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql rename wien_talks/wien_talks_server/migrations/{20250816171653001 => 20250816215043551}/definition.json (97%) rename wien_talks/wien_talks_server/migrations/{20250816122625449 => 20250816215043551}/definition.sql (97%) rename wien_talks/wien_talks_server/migrations/{20250816171653001 => 20250816215043551}/definition_project.json (68%) create mode 100644 wien_talks/wien_talks_server/migrations/20250816215043551/migration.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql rename wien_talks/wien_talks_server/migrations/{20250816095813247 => 20250816215049795}/definition.json (62%) rename wien_talks/wien_talks_server/migrations/{20250816095813247 => 20250816215049795}/definition.sql (63%) create mode 100644 wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816215049795/migration.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816215102447/definition.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816215102447/migration.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816220051483/definition.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql create mode 100644 wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816220051483/migration.json create mode 100644 wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql diff --git a/wien_talks/wien_talks_client/lib/src/protocol/client.dart b/wien_talks/wien_talks_client/lib/src/protocol/client.dart index dcae10e..431e580 100644 --- a/wien_talks/wien_talks_client/lib/src/protocol/client.dart +++ b/wien_talks/wien_talks_client/lib/src/protocol/client.dart @@ -11,13 +11,35 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_client/serverpod_client.dart' as _i1; import 'dart:async' as _i2; -import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i3; -import 'package:wien_talks_client/src/protocol/quotes/create_quote.dart' as _i4; -import 'package:wien_talks_client/src/protocol/votes/vote.dart' as _i5; -import 'package:wien_talks_client/src/protocol/votes/vote_request.dart' as _i6; +import 'package:wien_talks_client/src/protocol/health.dart' as _i3; +import 'package:wien_talks_client/src/protocol/quote.dart' as _i4; +import 'package:wien_talks_client/src/protocol/create_quote.dart' as _i5; +import 'package:wien_talks_client/src/protocol/vote.dart' as _i6; import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i7; import 'protocol.dart' as _i8; +/// {@category Endpoint} +class EndpointHealth extends _i1.EndpointRef { + EndpointHealth(_i1.EndpointCaller caller) : super(caller); + + @override + String get name => 'health'; + + _i2.Future<_i3.Health> ping({String? note}) => + caller.callServerEndpoint<_i3.Health>( + 'health', + 'ping', + {'note': note}, + ); + + _i2.Future> all() => + caller.callServerEndpoint>( + 'health', + 'all', + {}, + ); +} + /// {@category Endpoint} class EndpointQuote extends _i1.EndpointRef { EndpointQuote(_i1.EndpointCaller caller) : super(caller); @@ -25,22 +47,28 @@ class EndpointQuote extends _i1.EndpointRef { @override String get name => 'quote'; - _i2.Future<_i3.Quote> createQuote(_i4.CreateQuoteRequest req) => - caller.callServerEndpoint<_i3.Quote>( + _i2.Future dbPing() => caller.callServerEndpoint( + 'quote', + 'dbPing', + {}, + ); + + _i2.Future<_i4.Quote> createQuote(_i5.CreateQuoteRequest req) => + caller.callServerEndpoint<_i4.Quote>( 'quote', 'createQuote', {'req': req}, ); - _i2.Future updateQuote(_i3.Quote quote) => + _i2.Future updateQuote(_i4.Quote quote) => caller.callServerEndpoint( 'quote', 'updateQuote', {'quote': quote}, ); - _i2.Future> getAllQuotes() => - caller.callServerEndpoint>( + _i2.Future> getAllQuotes() => + caller.callServerEndpoint>( 'quote', 'getAllQuotes', {}, @@ -54,19 +82,24 @@ class EndpointVotes extends _i1.EndpointRef { @override String get name => 'votes'; - _i2.Future<_i5.Vote> postVote(_i6.VoteRequest voteRequest) => - caller.callServerEndpoint<_i5.Vote>( - 'votes', - 'postVote', - {'voteRequest': voteRequest}, - ); - - _i2.Future> getAllVotes() => - caller.callServerEndpoint>( + _i2.Future> getAllVotes() => + caller.callServerEndpoint>( 'votes', 'getAllVotes', {}, ); + + _i2.Future createVote() => caller.callServerEndpoint( + 'votes', + 'createVote', + {}, + ); + + _i2.Future sayHello() => caller.callServerEndpoint( + 'votes', + 'sayHello', + {}, + ); } class Modules { @@ -103,11 +136,14 @@ class Client extends _i1.ServerpodClientShared { disconnectStreamsOnLostInternetConnection: disconnectStreamsOnLostInternetConnection, ) { + health = EndpointHealth(this); quote = EndpointQuote(this); votes = EndpointVotes(this); modules = Modules(this); } + late final EndpointHealth health; + late final EndpointQuote quote; late final EndpointVotes votes; @@ -116,6 +152,7 @@ class Client extends _i1.ServerpodClientShared { @override Map get endpointRefLookup => { + 'health': health, 'quote': quote, 'votes': votes, }; diff --git a/wien_talks/wien_talks_client/lib/src/protocol/quotes/create_quote.dart b/wien_talks/wien_talks_client/lib/src/protocol/create_quote.dart similarity index 100% rename from wien_talks/wien_talks_client/lib/src/protocol/quotes/create_quote.dart rename to wien_talks/wien_talks_client/lib/src/protocol/create_quote.dart diff --git a/wien_talks/wien_talks_client/lib/src/protocol/health.dart b/wien_talks/wien_talks_client/lib/src/protocol/health.dart new file mode 100644 index 0000000..e16054f --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/health.dart @@ -0,0 +1,96 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _i1; + +abstract class Health implements _i1.SerializableModel { + Health._({ + this.id, + required this.createdAt, + this.note, + }); + + factory Health({ + int? id, + required DateTime createdAt, + String? note, + }) = _HealthImpl; + + factory Health.fromJson(Map jsonSerialization) { + return Health( + id: jsonSerialization['id'] as int?, + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + note: jsonSerialization['note'] as String?, + ); + } + + /// The database id, set if the object has been inserted into the + /// database or if it has been fetched from the database. Otherwise, + /// the id will be null. + int? id; + + DateTime createdAt; + + String? note; + + /// Returns a shallow copy of this [Health] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Health copyWith({ + int? id, + DateTime? createdAt, + String? note, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'createdAt': createdAt.toJson(), + if (note != null) 'note': note, + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _HealthImpl extends Health { + _HealthImpl({ + int? id, + required DateTime createdAt, + String? note, + }) : super._( + id: id, + createdAt: createdAt, + note: note, + ); + + /// Returns a shallow copy of this [Health] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Health copyWith({ + Object? id = _Undefined, + DateTime? createdAt, + Object? note = _Undefined, + }) { + return Health( + id: id is int? ? id : this.id, + createdAt: createdAt ?? this.createdAt, + note: note is String? ? note : this.note, + ); + } +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart b/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart index b709655..23f8d65 100644 --- a/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart +++ b/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart @@ -10,17 +10,18 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_client/serverpod_client.dart' as _i1; -import 'quotes/create_quote.dart' as _i2; -import 'quotes/quote.dart' as _i3; -import 'votes/vote.dart' as _i4; -import 'votes/vote_request.dart' as _i5; -import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i6; -import 'package:wien_talks_client/src/protocol/votes/vote.dart' as _i7; -import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i8; -export 'quotes/create_quote.dart'; -export 'quotes/quote.dart'; -export 'votes/vote.dart'; -export 'votes/vote_request.dart'; +import 'create_quote.dart' as _i2; +import 'health.dart' as _i3; +import 'quote.dart' as _i4; +import 'vote.dart' as _i5; +import 'package:wien_talks_client/src/protocol/health.dart' as _i6; +import 'package:wien_talks_client/src/protocol/quote.dart' as _i7; +import 'package:wien_talks_client/src/protocol/vote.dart' as _i8; +import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i9; +export 'create_quote.dart'; +export 'health.dart'; +export 'quote.dart'; +export 'vote.dart'; export 'client.dart'; class Protocol extends _i1.SerializationManager { @@ -39,26 +40,26 @@ class Protocol extends _i1.SerializationManager { if (t == _i2.CreateQuoteRequest) { return _i2.CreateQuoteRequest.fromJson(data) as T; } - if (t == _i3.Quote) { - return _i3.Quote.fromJson(data) as T; + if (t == _i3.Health) { + return _i3.Health.fromJson(data) as T; } - if (t == _i4.Vote) { - return _i4.Vote.fromJson(data) as T; + if (t == _i4.Quote) { + return _i4.Quote.fromJson(data) as T; } - if (t == _i5.VoteRequest) { - return _i5.VoteRequest.fromJson(data) as T; + if (t == _i5.Vote) { + return _i5.Vote.fromJson(data) as T; } if (t == _i1.getType<_i2.CreateQuoteRequest?>()) { return (data != null ? _i2.CreateQuoteRequest.fromJson(data) : null) as T; } - if (t == _i1.getType<_i3.Quote?>()) { - return (data != null ? _i3.Quote.fromJson(data) : null) as T; + if (t == _i1.getType<_i3.Health?>()) { + return (data != null ? _i3.Health.fromJson(data) : null) as T; } - if (t == _i1.getType<_i4.Vote?>()) { - return (data != null ? _i4.Vote.fromJson(data) : null) as T; + if (t == _i1.getType<_i4.Quote?>()) { + return (data != null ? _i4.Quote.fromJson(data) : null) as T; } - if (t == _i1.getType<_i5.VoteRequest?>()) { - return (data != null ? _i5.VoteRequest.fromJson(data) : null) as T; + if (t == _i1.getType<_i5.Vote?>()) { + return (data != null ? _i5.Vote.fromJson(data) : null) as T; } if (t == _i1.getType?>()) { return (data != null @@ -70,14 +71,18 @@ class Protocol extends _i1.SerializationManager { ? (data as List).map((e) => deserialize(e)).toList() : null) as T; } - if (t == List<_i6.Quote>) { - return (data as List).map((e) => deserialize<_i6.Quote>(e)).toList() as T; + if (t == List<_i6.Health>) { + return (data as List).map((e) => deserialize<_i6.Health>(e)).toList() + as T; } - if (t == List<_i7.Vote>) { - return (data as List).map((e) => deserialize<_i7.Vote>(e)).toList() as T; + if (t == List<_i7.Quote>) { + return (data as List).map((e) => deserialize<_i7.Quote>(e)).toList() as T; + } + if (t == List<_i8.Vote>) { + return (data as List).map((e) => deserialize<_i8.Vote>(e)).toList() as T; } try { - return _i8.Protocol().deserialize(data, t); + return _i9.Protocol().deserialize(data, t); } on _i1.DeserializationTypeNotFoundException catch (_) {} return super.deserialize(data, t); } @@ -89,16 +94,16 @@ class Protocol extends _i1.SerializationManager { if (data is _i2.CreateQuoteRequest) { return 'CreateQuoteRequest'; } - if (data is _i3.Quote) { + if (data is _i3.Health) { + return 'Health'; + } + if (data is _i4.Quote) { return 'Quote'; } - if (data is _i4.Vote) { + if (data is _i5.Vote) { return 'Vote'; } - if (data is _i5.VoteRequest) { - return 'VoteRequest'; - } - className = _i8.Protocol().getClassNameForObject(data); + className = _i9.Protocol().getClassNameForObject(data); if (className != null) { return 'serverpod_auth.$className'; } @@ -114,18 +119,18 @@ class Protocol extends _i1.SerializationManager { if (dataClassName == 'CreateQuoteRequest') { return deserialize<_i2.CreateQuoteRequest>(data['data']); } + if (dataClassName == 'Health') { + return deserialize<_i3.Health>(data['data']); + } if (dataClassName == 'Quote') { - return deserialize<_i3.Quote>(data['data']); + return deserialize<_i4.Quote>(data['data']); } if (dataClassName == 'Vote') { - return deserialize<_i4.Vote>(data['data']); - } - if (dataClassName == 'VoteRequest') { - return deserialize<_i5.VoteRequest>(data['data']); + return deserialize<_i5.Vote>(data['data']); } if (dataClassName.startsWith('serverpod_auth.')) { data['className'] = dataClassName.substring(15); - return _i8.Protocol().deserializeByClassName(data); + return _i9.Protocol().deserializeByClassName(data); } return super.deserializeByClassName(data); } diff --git a/wien_talks/wien_talks_client/lib/src/protocol/quotes/quote.dart b/wien_talks/wien_talks_client/lib/src/protocol/quote.dart similarity index 100% rename from wien_talks/wien_talks_client/lib/src/protocol/quotes/quote.dart rename to wien_talks/wien_talks_client/lib/src/protocol/quote.dart diff --git a/wien_talks/wien_talks_client/lib/src/protocol/votes/vote.dart b/wien_talks/wien_talks_client/lib/src/protocol/vote.dart similarity index 87% rename from wien_talks/wien_talks_client/lib/src/protocol/votes/vote.dart rename to wien_talks/wien_talks_client/lib/src/protocol/vote.dart index 5e969f1..3bb8102 100644 --- a/wien_talks/wien_talks_client/lib/src/protocol/votes/vote.dart +++ b/wien_talks/wien_talks_client/lib/src/protocol/vote.dart @@ -10,14 +10,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_client/serverpod_client.dart' as _i1; -import '../quotes/quote.dart' as _i2; abstract class Vote implements _i1.SerializableModel { Vote._({ this.id, required this.userId, required this.createdAt, - required this.quote, + required this.quoteId, required this.upvote, }); @@ -25,7 +24,7 @@ abstract class Vote implements _i1.SerializableModel { int? id, required int userId, required DateTime createdAt, - required _i2.Quote quote, + required int quoteId, required bool upvote, }) = _VoteImpl; @@ -35,8 +34,7 @@ abstract class Vote implements _i1.SerializableModel { userId: jsonSerialization['userId'] as int, createdAt: _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), - quote: _i2.Quote.fromJson( - (jsonSerialization['quote'] as Map)), + quoteId: jsonSerialization['quoteId'] as int, upvote: jsonSerialization['upvote'] as bool, ); } @@ -50,7 +48,7 @@ abstract class Vote implements _i1.SerializableModel { DateTime createdAt; - _i2.Quote quote; + int quoteId; bool upvote; @@ -61,7 +59,7 @@ abstract class Vote implements _i1.SerializableModel { int? id, int? userId, DateTime? createdAt, - _i2.Quote? quote, + int? quoteId, bool? upvote, }); @override @@ -70,7 +68,7 @@ abstract class Vote implements _i1.SerializableModel { if (id != null) 'id': id, 'userId': userId, 'createdAt': createdAt.toJson(), - 'quote': quote.toJson(), + 'quoteId': quoteId, 'upvote': upvote, }; } @@ -88,13 +86,13 @@ class _VoteImpl extends Vote { int? id, required int userId, required DateTime createdAt, - required _i2.Quote quote, + required int quoteId, required bool upvote, }) : super._( id: id, userId: userId, createdAt: createdAt, - quote: quote, + quoteId: quoteId, upvote: upvote, ); @@ -106,14 +104,14 @@ class _VoteImpl extends Vote { Object? id = _Undefined, int? userId, DateTime? createdAt, - _i2.Quote? quote, + int? quoteId, bool? upvote, }) { return Vote( id: id is int? ? id : this.id, userId: userId ?? this.userId, createdAt: createdAt ?? this.createdAt, - quote: quote ?? this.quote.copyWith(), + quoteId: quoteId ?? this.quoteId, upvote: upvote ?? this.upvote, ); } diff --git a/wien_talks/wien_talks_client/lib/src/protocol/votes/vote_request.dart b/wien_talks/wien_talks_client/lib/src/protocol/votes/vote_request.dart deleted file mode 100644 index baf48e9..0000000 --- a/wien_talks/wien_talks_client/lib/src/protocol/votes/vote_request.dart +++ /dev/null @@ -1,108 +0,0 @@ -/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ -/* To generate run: "serverpod generate" */ - -// ignore_for_file: implementation_imports -// ignore_for_file: library_private_types_in_public_api -// ignore_for_file: non_constant_identifier_names -// ignore_for_file: public_member_api_docs -// ignore_for_file: type_literal_in_constant_pattern -// ignore_for_file: use_super_parameters - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:serverpod_client/serverpod_client.dart' as _i1; -import '../quotes/quote.dart' as _i2; - -abstract class VoteRequest implements _i1.SerializableModel { - VoteRequest._({ - this.id, - required this.userId, - required this.quote, - required this.upvote, - }); - - factory VoteRequest({ - int? id, - required int userId, - required _i2.Quote quote, - required bool upvote, - }) = _VoteRequestImpl; - - factory VoteRequest.fromJson(Map jsonSerialization) { - return VoteRequest( - id: jsonSerialization['id'] as int?, - userId: jsonSerialization['userId'] as int, - quote: _i2.Quote.fromJson( - (jsonSerialization['quote'] as Map)), - upvote: jsonSerialization['upvote'] as bool, - ); - } - - /// The database id, set if the object has been inserted into the - /// database or if it has been fetched from the database. Otherwise, - /// the id will be null. - int? id; - - int userId; - - _i2.Quote quote; - - bool upvote; - - /// Returns a shallow copy of this [VoteRequest] - /// with some or all fields replaced by the given arguments. - @_i1.useResult - VoteRequest copyWith({ - int? id, - int? userId, - _i2.Quote? quote, - bool? upvote, - }); - @override - Map toJson() { - return { - if (id != null) 'id': id, - 'userId': userId, - 'quote': quote.toJson(), - 'upvote': upvote, - }; - } - - @override - String toString() { - return _i1.SerializationManager.encode(this); - } -} - -class _Undefined {} - -class _VoteRequestImpl extends VoteRequest { - _VoteRequestImpl({ - int? id, - required int userId, - required _i2.Quote quote, - required bool upvote, - }) : super._( - id: id, - userId: userId, - quote: quote, - upvote: upvote, - ); - - /// Returns a shallow copy of this [VoteRequest] - /// with some or all fields replaced by the given arguments. - @_i1.useResult - @override - VoteRequest copyWith({ - Object? id = _Undefined, - int? userId, - _i2.Quote? quote, - bool? upvote, - }) { - return VoteRequest( - id: id is int? ? id : this.id, - userId: userId ?? this.userId, - quote: quote ?? this.quote.copyWith(), - upvote: upvote ?? this.upvote, - ); - } -} diff --git a/wien_talks/wien_talks_flutter/lib/helper/go_router.dart b/wien_talks/wien_talks_flutter/lib/helper/go_router.dart index bca0dc4..2c3c38b 100644 --- a/wien_talks/wien_talks_flutter/lib/helper/go_router.dart +++ b/wien_talks/wien_talks_flutter/lib/helper/go_router.dart @@ -7,7 +7,7 @@ import 'package:wien_talks_flutter/news_screen.dart'; final router = GoRouter( redirect: (context, state) { - final loggedIn = AuthService.user != null; + final loggedIn = true; // AuthService.user != null; final atLogin = state.matchedLocation == '/login'; if (!loggedIn && !atLogin) return '/login'; if (loggedIn && atLogin) return '/'; diff --git a/wien_talks/wien_talks_server/lib/server.dart b/wien_talks/wien_talks_server/lib/server.dart index e79820c..f324003 100644 --- a/wien_talks/wien_talks_server/lib/server.dart +++ b/wien_talks/wien_talks_server/lib/server.dart @@ -1,20 +1,20 @@ -import 'package:serverpod/serverpod.dart'; -import 'package:serverpod_auth_server/serverpod_auth_server.dart' as auth; -import 'package:wien_talks_server/src/web/routes/root.dart'; - -import 'src/generated/endpoints.dart'; - // This is the starting point of your Serverpod server. In most cases, you will // only need to make additions to this file if you add future calls, are // configuring Relic (Serverpod's web-server), or need custom setup work. +import 'package:serverpod/serverpod.dart'; + +import 'src/generated/endpoints.dart'; +import 'src/generated/protocol.dart'; +import 'src/web/routes/root.dart'; + void run(List args) async { // Initialize Serverpod and connect it with your generated code. final pod = Serverpod( args, - auth.Protocol(), + Protocol(), Endpoints(), - authenticationHandler: auth.authenticationHandler, + // authenticationHandler: authenticationHandler, ); // Setup a default page at the web root. diff --git a/wien_talks/wien_talks_server/lib/src/generated/quotes/create_quote.dart b/wien_talks/wien_talks_server/lib/src/generated/create_quote.dart similarity index 100% rename from wien_talks/wien_talks_server/lib/src/generated/quotes/create_quote.dart rename to wien_talks/wien_talks_server/lib/src/generated/create_quote.dart diff --git a/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart b/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart index c6cdd86..d7bddaf 100644 --- a/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart +++ b/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart @@ -10,41 +10,88 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; -import '../quotes/quotes_endpoint.dart' as _i2; -import '../votes/votes_endpoint.dart' as _i3; -import 'package:wien_talks_server/src/generated/quotes/create_quote.dart' - as _i4; -import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i5; -import 'package:wien_talks_server/src/generated/votes/vote_request.dart' as _i6; +import '../health/health-endpoint.dart' as _i2; +import '../quotes/quotes_endpoint.dart' as _i3; +import '../votes/votes_endpoint.dart' as _i4; +import 'package:wien_talks_server/src/generated/create_quote.dart' as _i5; +import 'package:wien_talks_server/src/generated/quote.dart' as _i6; import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i7; class Endpoints extends _i1.EndpointDispatch { @override void initializeEndpoints(_i1.Server server) { var endpoints = { - 'quote': _i2.QuoteEndpoint() + 'health': _i2.HealthEndpoint() + ..initialize( + server, + 'health', + null, + ), + 'quote': _i3.QuoteEndpoint() ..initialize( server, 'quote', null, ), - 'votes': _i3.VotesEndpoint() + 'votes': _i4.VotesEndpoint() ..initialize( server, 'votes', null, ), }; + connectors['health'] = _i1.EndpointConnector( + name: 'health', + endpoint: endpoints['health']!, + methodConnectors: { + 'ping': _i1.MethodConnector( + name: 'ping', + params: { + 'note': _i1.ParameterDescription( + name: 'note', + type: _i1.getType(), + nullable: true, + ) + }, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['health'] as _i2.HealthEndpoint).ping( + session, + note: params['note'], + ), + ), + 'all': _i1.MethodConnector( + name: 'all', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['health'] as _i2.HealthEndpoint).all(session), + ), + }, + ); connectors['quote'] = _i1.EndpointConnector( name: 'quote', endpoint: endpoints['quote']!, methodConnectors: { + 'dbPing': _i1.MethodConnector( + name: 'dbPing', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['quote'] as _i3.QuoteEndpoint).dbPing(session), + ), 'createQuote': _i1.MethodConnector( name: 'createQuote', params: { 'req': _i1.ParameterDescription( name: 'req', - type: _i1.getType<_i4.CreateQuoteRequest>(), + type: _i1.getType<_i5.CreateQuoteRequest>(), nullable: false, ) }, @@ -52,7 +99,7 @@ class Endpoints extends _i1.EndpointDispatch { _i1.Session session, Map params, ) async => - (endpoints['quote'] as _i2.QuoteEndpoint).createQuote( + (endpoints['quote'] as _i3.QuoteEndpoint).createQuote( session, params['req'], ), @@ -62,7 +109,7 @@ class Endpoints extends _i1.EndpointDispatch { params: { 'quote': _i1.ParameterDescription( name: 'quote', - type: _i1.getType<_i5.Quote>(), + type: _i1.getType<_i6.Quote>(), nullable: false, ) }, @@ -70,7 +117,7 @@ class Endpoints extends _i1.EndpointDispatch { _i1.Session session, Map params, ) async => - (endpoints['quote'] as _i2.QuoteEndpoint).updateQuote( + (endpoints['quote'] as _i3.QuoteEndpoint).updateQuote( session, params['quote'], ), @@ -82,7 +129,7 @@ class Endpoints extends _i1.EndpointDispatch { _i1.Session session, Map params, ) async => - (endpoints['quote'] as _i2.QuoteEndpoint).getAllQuotes(session), + (endpoints['quote'] as _i3.QuoteEndpoint).getAllQuotes(session), ), }, ); @@ -90,24 +137,6 @@ class Endpoints extends _i1.EndpointDispatch { name: 'votes', endpoint: endpoints['votes']!, methodConnectors: { - 'postVote': _i1.MethodConnector( - name: 'postVote', - params: { - 'voteRequest': _i1.ParameterDescription( - name: 'voteRequest', - type: _i1.getType<_i6.VoteRequest>(), - nullable: false, - ) - }, - call: ( - _i1.Session session, - Map params, - ) async => - (endpoints['votes'] as _i3.VotesEndpoint).postVote( - session, - params['voteRequest'], - ), - ), 'getAllVotes': _i1.MethodConnector( name: 'getAllVotes', params: {}, @@ -115,7 +144,25 @@ class Endpoints extends _i1.EndpointDispatch { _i1.Session session, Map params, ) async => - (endpoints['votes'] as _i3.VotesEndpoint).getAllVotes(session), + (endpoints['votes'] as _i4.VotesEndpoint).getAllVotes(session), + ), + 'createVote': _i1.MethodConnector( + name: 'createVote', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['votes'] as _i4.VotesEndpoint).createVote(session), + ), + 'sayHello': _i1.MethodConnector( + name: 'sayHello', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['votes'] as _i4.VotesEndpoint).sayHello(session), ), }, ); diff --git a/wien_talks/wien_talks_server/lib/src/generated/votes/vote_request.dart b/wien_talks/wien_talks_server/lib/src/generated/health.dart similarity index 50% rename from wien_talks/wien_talks_server/lib/src/generated/votes/vote_request.dart rename to wien_talks/wien_talks_server/lib/src/generated/health.dart index 4c03e8a..246819f 100644 --- a/wien_talks/wien_talks_server/lib/src/generated/votes/vote_request.dart +++ b/wien_talks/wien_talks_server/lib/src/generated/health.dart @@ -10,66 +10,57 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; -import '../quotes/quote.dart' as _i2; -abstract class VoteRequest - implements _i1.TableRow, _i1.ProtocolSerialization { - VoteRequest._({ +abstract class Health implements _i1.TableRow, _i1.ProtocolSerialization { + Health._({ this.id, - required this.userId, - required this.quote, - required this.upvote, + required this.createdAt, + this.note, }); - factory VoteRequest({ + factory Health({ int? id, - required int userId, - required _i2.Quote quote, - required bool upvote, - }) = _VoteRequestImpl; + required DateTime createdAt, + String? note, + }) = _HealthImpl; - factory VoteRequest.fromJson(Map jsonSerialization) { - return VoteRequest( + factory Health.fromJson(Map jsonSerialization) { + return Health( id: jsonSerialization['id'] as int?, - userId: jsonSerialization['userId'] as int, - quote: _i2.Quote.fromJson( - (jsonSerialization['quote'] as Map)), - upvote: jsonSerialization['upvote'] as bool, + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + note: jsonSerialization['note'] as String?, ); } - static final t = VoteRequestTable(); + static final t = HealthTable(); - static const db = VoteRequestRepository._(); + static const db = HealthRepository._(); @override int? id; - int userId; + DateTime createdAt; - _i2.Quote quote; - - bool upvote; + String? note; @override _i1.Table get table => t; - /// Returns a shallow copy of this [VoteRequest] + /// Returns a shallow copy of this [Health] /// with some or all fields replaced by the given arguments. @_i1.useResult - VoteRequest copyWith({ + Health copyWith({ int? id, - int? userId, - _i2.Quote? quote, - bool? upvote, + DateTime? createdAt, + String? note, }); @override Map toJson() { return { if (id != null) 'id': id, - 'userId': userId, - 'quote': quote.toJson(), - 'upvote': upvote, + 'createdAt': createdAt.toJson(), + if (note != null) 'note': note, }; } @@ -77,32 +68,31 @@ abstract class VoteRequest Map toJsonForProtocol() { return { if (id != null) 'id': id, - 'userId': userId, - 'quote': quote.toJsonForProtocol(), - 'upvote': upvote, + 'createdAt': createdAt.toJson(), + if (note != null) 'note': note, }; } - static VoteRequestInclude include() { - return VoteRequestInclude._(); + static HealthInclude include() { + return HealthInclude._(); } - static VoteRequestIncludeList includeList({ - _i1.WhereExpressionBuilder? where, + static HealthIncludeList includeList({ + _i1.WhereExpressionBuilder? where, int? limit, int? offset, - _i1.OrderByBuilder? orderBy, + _i1.OrderByBuilder? orderBy, bool orderDescending = false, - _i1.OrderByListBuilder? orderByList, - VoteRequestInclude? include, + _i1.OrderByListBuilder? orderByList, + HealthInclude? include, }) { - return VoteRequestIncludeList._( + return HealthIncludeList._( where: where, limit: limit, offset: offset, - orderBy: orderBy?.call(VoteRequest.t), + orderBy: orderBy?.call(Health.t), orderDescending: orderDescending, - orderByList: orderByList?.call(VoteRequest.t), + orderByList: orderByList?.call(Health.t), include: include, ); } @@ -115,82 +105,71 @@ abstract class VoteRequest class _Undefined {} -class _VoteRequestImpl extends VoteRequest { - _VoteRequestImpl({ +class _HealthImpl extends Health { + _HealthImpl({ int? id, - required int userId, - required _i2.Quote quote, - required bool upvote, + required DateTime createdAt, + String? note, }) : super._( id: id, - userId: userId, - quote: quote, - upvote: upvote, + createdAt: createdAt, + note: note, ); - /// Returns a shallow copy of this [VoteRequest] + /// Returns a shallow copy of this [Health] /// with some or all fields replaced by the given arguments. @_i1.useResult @override - VoteRequest copyWith({ + Health copyWith({ Object? id = _Undefined, - int? userId, - _i2.Quote? quote, - bool? upvote, + DateTime? createdAt, + Object? note = _Undefined, }) { - return VoteRequest( + return Health( id: id is int? ? id : this.id, - userId: userId ?? this.userId, - quote: quote ?? this.quote.copyWith(), - upvote: upvote ?? this.upvote, + createdAt: createdAt ?? this.createdAt, + note: note is String? ? note : this.note, ); } } -class VoteRequestTable extends _i1.Table { - VoteRequestTable({super.tableRelation}) : super(tableName: 'vote_request') { - userId = _i1.ColumnInt( - 'userId', +class HealthTable extends _i1.Table { + HealthTable({super.tableRelation}) : super(tableName: 'health') { + createdAt = _i1.ColumnDateTime( + 'createdAt', this, ); - quote = _i1.ColumnSerializable( - 'quote', - this, - ); - upvote = _i1.ColumnBool( - 'upvote', + note = _i1.ColumnString( + 'note', this, ); } - late final _i1.ColumnInt userId; + late final _i1.ColumnDateTime createdAt; - late final _i1.ColumnSerializable quote; - - late final _i1.ColumnBool upvote; + late final _i1.ColumnString note; @override List<_i1.Column> get columns => [ id, - userId, - quote, - upvote, + createdAt, + note, ]; } -class VoteRequestInclude extends _i1.IncludeObject { - VoteRequestInclude._(); +class HealthInclude extends _i1.IncludeObject { + HealthInclude._(); @override Map get includes => {}; @override - _i1.Table get table => VoteRequest.t; + _i1.Table get table => Health.t; } -class VoteRequestIncludeList extends _i1.IncludeList { - VoteRequestIncludeList._({ - _i1.WhereExpressionBuilder? where, +class HealthIncludeList extends _i1.IncludeList { + HealthIncludeList._({ + _i1.WhereExpressionBuilder? where, super.limit, super.offset, super.orderBy, @@ -198,20 +177,20 @@ class VoteRequestIncludeList extends _i1.IncludeList { super.orderByList, super.include, }) { - super.where = where?.call(VoteRequest.t); + super.where = where?.call(Health.t); } @override Map get includes => include?.includes ?? {}; @override - _i1.Table get table => VoteRequest.t; + _i1.Table get table => Health.t; } -class VoteRequestRepository { - const VoteRequestRepository._(); +class HealthRepository { + const HealthRepository._(); - /// Returns a list of [VoteRequest]s matching the given query parameters. + /// Returns a list of [Health]s matching the given query parameters. /// /// Use [where] to specify which items to include in the return value. /// If none is specified, all items will be returned. @@ -233,20 +212,20 @@ class VoteRequestRepository { /// limit: 100, /// ); /// ``` - Future> find( + Future> find( _i1.Session session, { - _i1.WhereExpressionBuilder? where, + _i1.WhereExpressionBuilder? where, int? limit, int? offset, - _i1.OrderByBuilder? orderBy, + _i1.OrderByBuilder? orderBy, bool orderDescending = false, - _i1.OrderByListBuilder? orderByList, + _i1.OrderByListBuilder? orderByList, _i1.Transaction? transaction, }) async { - return session.db.find( - where: where?.call(VoteRequest.t), - orderBy: orderBy?.call(VoteRequest.t), - orderByList: orderByList?.call(VoteRequest.t), + return session.db.find( + where: where?.call(Health.t), + orderBy: orderBy?.call(Health.t), + orderByList: orderByList?.call(Health.t), orderDescending: orderDescending, limit: limit, offset: offset, @@ -254,7 +233,7 @@ class VoteRequestRepository { ); } - /// Returns the first matching [VoteRequest] matching the given query parameters. + /// Returns the first matching [Health] matching the given query parameters. /// /// Use [where] to specify which items to include in the return value. /// If none is specified, all items will be returned. @@ -271,136 +250,136 @@ class VoteRequestRepository { /// orderBy: (t) => t.age, /// ); /// ``` - Future findFirstRow( + Future findFirstRow( _i1.Session session, { - _i1.WhereExpressionBuilder? where, + _i1.WhereExpressionBuilder? where, int? offset, - _i1.OrderByBuilder? orderBy, + _i1.OrderByBuilder? orderBy, bool orderDescending = false, - _i1.OrderByListBuilder? orderByList, + _i1.OrderByListBuilder? orderByList, _i1.Transaction? transaction, }) async { - return session.db.findFirstRow( - where: where?.call(VoteRequest.t), - orderBy: orderBy?.call(VoteRequest.t), - orderByList: orderByList?.call(VoteRequest.t), + return session.db.findFirstRow( + where: where?.call(Health.t), + orderBy: orderBy?.call(Health.t), + orderByList: orderByList?.call(Health.t), orderDescending: orderDescending, offset: offset, transaction: transaction, ); } - /// Finds a single [VoteRequest] by its [id] or null if no such row exists. - Future findById( + /// Finds a single [Health] by its [id] or null if no such row exists. + Future findById( _i1.Session session, int id, { _i1.Transaction? transaction, }) async { - return session.db.findById( + return session.db.findById( id, transaction: transaction, ); } - /// Inserts all [VoteRequest]s in the list and returns the inserted rows. + /// Inserts all [Health]s in the list and returns the inserted rows. /// - /// The returned [VoteRequest]s will have their `id` fields set. + /// The returned [Health]s will have their `id` fields set. /// /// This is an atomic operation, meaning that if one of the rows fails to /// insert, none of the rows will be inserted. - Future> insert( + Future> insert( _i1.Session session, - List rows, { + List rows, { _i1.Transaction? transaction, }) async { - return session.db.insert( + return session.db.insert( rows, transaction: transaction, ); } - /// Inserts a single [VoteRequest] and returns the inserted row. + /// Inserts a single [Health] and returns the inserted row. /// - /// The returned [VoteRequest] will have its `id` field set. - Future insertRow( + /// The returned [Health] will have its `id` field set. + Future insertRow( _i1.Session session, - VoteRequest row, { + Health row, { _i1.Transaction? transaction, }) async { - return session.db.insertRow( + return session.db.insertRow( row, transaction: transaction, ); } - /// Updates all [VoteRequest]s in the list and returns the updated rows. If + /// Updates all [Health]s in the list and returns the updated rows. If /// [columns] is provided, only those columns will be updated. Defaults to /// all columns. /// This is an atomic operation, meaning that if one of the rows fails to /// update, none of the rows will be updated. - Future> update( + Future> update( _i1.Session session, - List rows, { - _i1.ColumnSelections? columns, + List rows, { + _i1.ColumnSelections? columns, _i1.Transaction? transaction, }) async { - return session.db.update( + return session.db.update( rows, - columns: columns?.call(VoteRequest.t), + columns: columns?.call(Health.t), transaction: transaction, ); } - /// Updates a single [VoteRequest]. The row needs to have its id set. + /// Updates a single [Health]. The row needs to have its id set. /// Optionally, a list of [columns] can be provided to only update those /// columns. Defaults to all columns. - Future updateRow( + Future updateRow( _i1.Session session, - VoteRequest row, { - _i1.ColumnSelections? columns, + Health row, { + _i1.ColumnSelections? columns, _i1.Transaction? transaction, }) async { - return session.db.updateRow( + return session.db.updateRow( row, - columns: columns?.call(VoteRequest.t), + columns: columns?.call(Health.t), transaction: transaction, ); } - /// Deletes all [VoteRequest]s in the list and returns the deleted rows. + /// Deletes all [Health]s in the list and returns the deleted rows. /// This is an atomic operation, meaning that if one of the rows fail to /// be deleted, none of the rows will be deleted. - Future> delete( + Future> delete( _i1.Session session, - List rows, { + List rows, { _i1.Transaction? transaction, }) async { - return session.db.delete( + return session.db.delete( rows, transaction: transaction, ); } - /// Deletes a single [VoteRequest]. - Future deleteRow( + /// Deletes a single [Health]. + Future deleteRow( _i1.Session session, - VoteRequest row, { + Health row, { _i1.Transaction? transaction, }) async { - return session.db.deleteRow( + return session.db.deleteRow( row, transaction: transaction, ); } /// Deletes all rows matching the [where] expression. - Future> deleteWhere( + Future> deleteWhere( _i1.Session session, { - required _i1.WhereExpressionBuilder where, + required _i1.WhereExpressionBuilder where, _i1.Transaction? transaction, }) async { - return session.db.deleteWhere( - where: where(VoteRequest.t), + return session.db.deleteWhere( + where: where(Health.t), transaction: transaction, ); } @@ -409,12 +388,12 @@ class VoteRequestRepository { /// will return the count of all rows in the table. Future count( _i1.Session session, { - _i1.WhereExpressionBuilder? where, + _i1.WhereExpressionBuilder? where, int? limit, _i1.Transaction? transaction, }) async { - return session.db.count( - where: where?.call(VoteRequest.t), + return session.db.count( + where: where?.call(Health.t), limit: limit, transaction: transaction, ); diff --git a/wien_talks/wien_talks_server/lib/src/generated/protocol.dart b/wien_talks/wien_talks_server/lib/src/generated/protocol.dart index b3ad4db..2cb9d22 100644 --- a/wien_talks/wien_talks_server/lib/src/generated/protocol.dart +++ b/wien_talks/wien_talks_server/lib/src/generated/protocol.dart @@ -12,16 +12,17 @@ import 'package:serverpod/serverpod.dart' as _i1; import 'package:serverpod/protocol.dart' as _i2; import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i3; -import 'quotes/create_quote.dart' as _i4; -import 'quotes/quote.dart' as _i5; -import 'votes/vote.dart' as _i6; -import 'votes/vote_request.dart' as _i7; -import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i8; -import 'package:wien_talks_server/src/generated/votes/vote.dart' as _i9; -export 'quotes/create_quote.dart'; -export 'quotes/quote.dart'; -export 'votes/vote.dart'; -export 'votes/vote_request.dart'; +import 'create_quote.dart' as _i4; +import 'health.dart' as _i5; +import 'quote.dart' as _i6; +import 'vote.dart' as _i7; +import 'package:wien_talks_server/src/generated/health.dart' as _i8; +import 'package:wien_talks_server/src/generated/quote.dart' as _i9; +import 'package:wien_talks_server/src/generated/vote.dart' as _i10; +export 'create_quote.dart'; +export 'health.dart'; +export 'quote.dart'; +export 'vote.dart'; class Protocol extends _i1.SerializationManagerServer { Protocol._(); @@ -31,6 +32,50 @@ class Protocol extends _i1.SerializationManagerServer { static final Protocol _instance = Protocol._(); static final List<_i2.TableDefinition> targetTableDefinitions = [ + _i2.TableDefinition( + name: 'health', + dartName: 'Health', + schema: 'public', + module: 'wien_talks', + columns: [ + _i2.ColumnDefinition( + name: 'id', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int?', + columnDefault: 'nextval(\'health_id_seq\'::regclass)', + ), + _i2.ColumnDefinition( + name: 'createdAt', + columnType: _i2.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + _i2.ColumnDefinition( + name: 'note', + columnType: _i2.ColumnType.text, + isNullable: true, + dartType: 'String?', + ), + ], + foreignKeys: [], + indexes: [ + _i2.IndexDefinition( + indexName: 'health_pkey', + tableSpace: null, + elements: [ + _i2.IndexElementDefinition( + type: _i2.IndexElementDefinitionType.column, + definition: 'id', + ) + ], + type: 'btree', + isUnique: true, + isPrimary: true, + ) + ], + managed: true, + ), _i2.TableDefinition( name: 'quote', dartName: 'Quote', @@ -149,10 +194,10 @@ class Protocol extends _i1.SerializationManagerServer { dartType: 'DateTime', ), _i2.ColumnDefinition( - name: 'quote', - columnType: _i2.ColumnType.json, + name: 'quoteId', + columnType: _i2.ColumnType.bigint, isNullable: false, - dartType: 'protocol:Quote', + dartType: 'int', ), _i2.ColumnDefinition( name: 'upvote', @@ -179,56 +224,6 @@ class Protocol extends _i1.SerializationManagerServer { ], managed: true, ), - _i2.TableDefinition( - name: 'vote_request', - dartName: 'VoteRequest', - schema: 'public', - module: 'wien_talks', - columns: [ - _i2.ColumnDefinition( - name: 'id', - columnType: _i2.ColumnType.bigint, - isNullable: false, - dartType: 'int?', - columnDefault: 'nextval(\'vote_request_id_seq\'::regclass)', - ), - _i2.ColumnDefinition( - name: 'userId', - columnType: _i2.ColumnType.bigint, - isNullable: false, - dartType: 'int', - ), - _i2.ColumnDefinition( - name: 'quote', - columnType: _i2.ColumnType.json, - isNullable: false, - dartType: 'protocol:Quote', - ), - _i2.ColumnDefinition( - name: 'upvote', - columnType: _i2.ColumnType.boolean, - isNullable: false, - dartType: 'bool', - ), - ], - foreignKeys: [], - indexes: [ - _i2.IndexDefinition( - indexName: 'vote_request_pkey', - tableSpace: null, - elements: [ - _i2.IndexElementDefinition( - type: _i2.IndexElementDefinitionType.column, - definition: 'id', - ) - ], - type: 'btree', - isUnique: true, - isPrimary: true, - ) - ], - managed: true, - ), ..._i3.Protocol.targetTableDefinitions, ..._i2.Protocol.targetTableDefinitions, ]; @@ -242,26 +237,26 @@ class Protocol extends _i1.SerializationManagerServer { if (t == _i4.CreateQuoteRequest) { return _i4.CreateQuoteRequest.fromJson(data) as T; } - if (t == _i5.Quote) { - return _i5.Quote.fromJson(data) as T; + if (t == _i5.Health) { + return _i5.Health.fromJson(data) as T; } - if (t == _i6.Vote) { - return _i6.Vote.fromJson(data) as T; + if (t == _i6.Quote) { + return _i6.Quote.fromJson(data) as T; } - if (t == _i7.VoteRequest) { - return _i7.VoteRequest.fromJson(data) as T; + if (t == _i7.Vote) { + return _i7.Vote.fromJson(data) as T; } if (t == _i1.getType<_i4.CreateQuoteRequest?>()) { return (data != null ? _i4.CreateQuoteRequest.fromJson(data) : null) as T; } - if (t == _i1.getType<_i5.Quote?>()) { - return (data != null ? _i5.Quote.fromJson(data) : null) as T; + if (t == _i1.getType<_i5.Health?>()) { + return (data != null ? _i5.Health.fromJson(data) : null) as T; } - if (t == _i1.getType<_i6.Vote?>()) { - return (data != null ? _i6.Vote.fromJson(data) : null) as T; + if (t == _i1.getType<_i6.Quote?>()) { + return (data != null ? _i6.Quote.fromJson(data) : null) as T; } - if (t == _i1.getType<_i7.VoteRequest?>()) { - return (data != null ? _i7.VoteRequest.fromJson(data) : null) as T; + if (t == _i1.getType<_i7.Vote?>()) { + return (data != null ? _i7.Vote.fromJson(data) : null) as T; } if (t == _i1.getType?>()) { return (data != null @@ -273,11 +268,15 @@ class Protocol extends _i1.SerializationManagerServer { ? (data as List).map((e) => deserialize(e)).toList() : null) as T; } - if (t == List<_i8.Quote>) { - return (data as List).map((e) => deserialize<_i8.Quote>(e)).toList() as T; + if (t == List<_i8.Health>) { + return (data as List).map((e) => deserialize<_i8.Health>(e)).toList() + as T; } - if (t == List<_i9.Vote>) { - return (data as List).map((e) => deserialize<_i9.Vote>(e)).toList() as T; + if (t == List<_i9.Quote>) { + return (data as List).map((e) => deserialize<_i9.Quote>(e)).toList() as T; + } + if (t == List<_i10.Vote>) { + return (data as List).map((e) => deserialize<_i10.Vote>(e)).toList() as T; } try { return _i3.Protocol().deserialize(data, t); @@ -295,15 +294,15 @@ class Protocol extends _i1.SerializationManagerServer { if (data is _i4.CreateQuoteRequest) { return 'CreateQuoteRequest'; } - if (data is _i5.Quote) { + if (data is _i5.Health) { + return 'Health'; + } + if (data is _i6.Quote) { return 'Quote'; } - if (data is _i6.Vote) { + if (data is _i7.Vote) { return 'Vote'; } - if (data is _i7.VoteRequest) { - return 'VoteRequest'; - } className = _i2.Protocol().getClassNameForObject(data); if (className != null) { return 'serverpod.$className'; @@ -324,14 +323,14 @@ class Protocol extends _i1.SerializationManagerServer { if (dataClassName == 'CreateQuoteRequest') { return deserialize<_i4.CreateQuoteRequest>(data['data']); } + if (dataClassName == 'Health') { + return deserialize<_i5.Health>(data['data']); + } if (dataClassName == 'Quote') { - return deserialize<_i5.Quote>(data['data']); + return deserialize<_i6.Quote>(data['data']); } if (dataClassName == 'Vote') { - return deserialize<_i6.Vote>(data['data']); - } - if (dataClassName == 'VoteRequest') { - return deserialize<_i7.VoteRequest>(data['data']); + return deserialize<_i7.Vote>(data['data']); } if (dataClassName.startsWith('serverpod.')) { data['className'] = dataClassName.substring(10); @@ -359,12 +358,12 @@ class Protocol extends _i1.SerializationManagerServer { } } switch (t) { - case _i5.Quote: - return _i5.Quote.t; - case _i6.Vote: - return _i6.Vote.t; - case _i7.VoteRequest: - return _i7.VoteRequest.t; + case _i5.Health: + return _i5.Health.t; + case _i6.Quote: + return _i6.Quote.t; + case _i7.Vote: + return _i7.Vote.t; } return null; } diff --git a/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml b/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml index 4628fc9..1e633c7 100644 --- a/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml +++ b/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml @@ -1,7 +1,12 @@ +health: + - ping: + - all: quote: + - dbPing: - createQuote: - updateQuote: - getAllQuotes: votes: - - postVote: - getAllVotes: + - createVote: + - sayHello: diff --git a/wien_talks/wien_talks_server/lib/src/generated/quotes/quote.dart b/wien_talks/wien_talks_server/lib/src/generated/quote.dart similarity index 100% rename from wien_talks/wien_talks_server/lib/src/generated/quotes/quote.dart rename to wien_talks/wien_talks_server/lib/src/generated/quote.dart diff --git a/wien_talks/wien_talks_server/lib/src/generated/votes/vote.dart b/wien_talks/wien_talks_server/lib/src/generated/vote.dart similarity index 95% rename from wien_talks/wien_talks_server/lib/src/generated/votes/vote.dart rename to wien_talks/wien_talks_server/lib/src/generated/vote.dart index a150695..5a7d1ed 100644 --- a/wien_talks/wien_talks_server/lib/src/generated/votes/vote.dart +++ b/wien_talks/wien_talks_server/lib/src/generated/vote.dart @@ -10,14 +10,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; -import '../quotes/quote.dart' as _i2; abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { Vote._({ this.id, required this.userId, required this.createdAt, - required this.quote, + required this.quoteId, required this.upvote, }); @@ -25,7 +24,7 @@ abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { int? id, required int userId, required DateTime createdAt, - required _i2.Quote quote, + required int quoteId, required bool upvote, }) = _VoteImpl; @@ -35,8 +34,7 @@ abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { userId: jsonSerialization['userId'] as int, createdAt: _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), - quote: _i2.Quote.fromJson( - (jsonSerialization['quote'] as Map)), + quoteId: jsonSerialization['quoteId'] as int, upvote: jsonSerialization['upvote'] as bool, ); } @@ -52,7 +50,7 @@ abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { DateTime createdAt; - _i2.Quote quote; + int quoteId; bool upvote; @@ -66,7 +64,7 @@ abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { int? id, int? userId, DateTime? createdAt, - _i2.Quote? quote, + int? quoteId, bool? upvote, }); @override @@ -75,7 +73,7 @@ abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { if (id != null) 'id': id, 'userId': userId, 'createdAt': createdAt.toJson(), - 'quote': quote.toJson(), + 'quoteId': quoteId, 'upvote': upvote, }; } @@ -86,7 +84,7 @@ abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { if (id != null) 'id': id, 'userId': userId, 'createdAt': createdAt.toJson(), - 'quote': quote.toJsonForProtocol(), + 'quoteId': quoteId, 'upvote': upvote, }; } @@ -128,13 +126,13 @@ class _VoteImpl extends Vote { int? id, required int userId, required DateTime createdAt, - required _i2.Quote quote, + required int quoteId, required bool upvote, }) : super._( id: id, userId: userId, createdAt: createdAt, - quote: quote, + quoteId: quoteId, upvote: upvote, ); @@ -146,14 +144,14 @@ class _VoteImpl extends Vote { Object? id = _Undefined, int? userId, DateTime? createdAt, - _i2.Quote? quote, + int? quoteId, bool? upvote, }) { return Vote( id: id is int? ? id : this.id, userId: userId ?? this.userId, createdAt: createdAt ?? this.createdAt, - quote: quote ?? this.quote.copyWith(), + quoteId: quoteId ?? this.quoteId, upvote: upvote ?? this.upvote, ); } @@ -169,8 +167,8 @@ class VoteTable extends _i1.Table { 'createdAt', this, ); - quote = _i1.ColumnSerializable( - 'quote', + quoteId = _i1.ColumnInt( + 'quoteId', this, ); upvote = _i1.ColumnBool( @@ -183,7 +181,7 @@ class VoteTable extends _i1.Table { late final _i1.ColumnDateTime createdAt; - late final _i1.ColumnSerializable quote; + late final _i1.ColumnInt quoteId; late final _i1.ColumnBool upvote; @@ -192,7 +190,7 @@ class VoteTable extends _i1.Table { id, userId, createdAt, - quote, + quoteId, upvote, ]; } diff --git a/wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart b/wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart new file mode 100644 index 0000000..c98d76e --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart @@ -0,0 +1,23 @@ +import 'package:serverpod/serverpod.dart'; +import 'package:wien_talks_server/src/generated/protocol.dart'; + +class HealthEndpoint extends Endpoint { + Future ping(Session session, {String? note}) async { + final row = await Health.db.insertRow( + session, + Health( + createdAt: DateTime.now().toUtc(), + note: note, + ), + ); + return row; + } + + Future> all(Session session) { + return Health.db.find( + session, + orderBy: (h) => h.createdAt, + orderDescending: true, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/quotes/create_quote.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/create_quote.spy.yaml similarity index 100% rename from wien_talks/wien_talks_server/lib/src/quotes/create_quote.spy.yaml rename to wien_talks/wien_talks_server/lib/src/models/create_quote.spy.yaml diff --git a/wien_talks/wien_talks_server/lib/src/models/health.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/health.spy.yaml new file mode 100644 index 0000000..779e344 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/models/health.spy.yaml @@ -0,0 +1,5 @@ +class: Health +table: health +fields: + createdAt: DateTime + note: String? diff --git a/wien_talks/wien_talks_server/lib/src/quotes/quote.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/quote.spy.yaml similarity index 100% rename from wien_talks/wien_talks_server/lib/src/quotes/quote.spy.yaml rename to wien_talks/wien_talks_server/lib/src/models/quote.spy.yaml diff --git a/wien_talks/wien_talks_server/lib/src/votes/vote.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/vote.spy.yaml similarity index 84% rename from wien_talks/wien_talks_server/lib/src/votes/vote.spy.yaml rename to wien_talks/wien_talks_server/lib/src/models/vote.spy.yaml index 072b1b8..2f1e878 100644 --- a/wien_talks/wien_talks_server/lib/src/votes/vote.spy.yaml +++ b/wien_talks/wien_talks_server/lib/src/models/vote.spy.yaml @@ -3,5 +3,5 @@ table: vote fields: userId: int createdAt: DateTime - quote: Quote + quoteId: int upvote: bool diff --git a/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart b/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart index f242d1c..b86f3eb 100644 --- a/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart +++ b/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart @@ -8,6 +8,13 @@ import 'package:wien_talks_server/src/quotes/quote_util.dart'; class QuoteEndpoint extends Endpoint { static const _channelQuoteUpdates = 'quote-updates'; + Future dbPing(Session session) async { + await session.db.unsafeQuery('SELECT 1;'); // connectivity + await session.db + .unsafeQuery('SELECT 1 FROM public.quote LIMIT 1;'); // table visible + return 'ok'; + } + Future createQuote(Session session, CreateQuoteRequest req) async { final authInfo = await session.authenticated; final userId = authInfo?.userId; @@ -44,8 +51,8 @@ class QuoteEndpoint extends Endpoint { final quoteList = await Quote.db.find( session, // where: (t) => t.visibility.equals(0), - // orderBy: (t) => t.createdAt, - // orderDescending: true, + orderBy: (t) => t.createdAt, + orderDescending: true, ); for (var element in quoteList) { diff --git a/wien_talks/wien_talks_server/lib/src/votes/vote_request.spy.yaml b/wien_talks/wien_talks_server/lib/src/votes/vote_request.spy.yaml deleted file mode 100644 index e6f5cf5..0000000 --- a/wien_talks/wien_talks_server/lib/src/votes/vote_request.spy.yaml +++ /dev/null @@ -1,6 +0,0 @@ -class: VoteRequest -table: vote_request -fields: - userId: int - quote: Quote - upvote: bool diff --git a/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart b/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart index 1e0d874..99b153c 100644 --- a/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart +++ b/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart @@ -1,21 +1,30 @@ +import 'dart:math'; + import 'package:serverpod/serverpod.dart'; import 'package:wien_talks_server/src/generated/protocol.dart'; class VotesEndpoint extends Endpoint { - Future postVote(Session session, VoteRequest voteRequest) async { - final row = Vote( - createdAt: DateTime.now(), - quote: voteRequest.quote, - upvote: voteRequest.upvote, - userId: voteRequest.userId); - - final persistedVote = await Vote.db.insertRow(session, row); - - return persistedVote; + Future> getAllVotes(Session session) async { + return await Vote.db.find( + session, + orderBy: (v) => v.createdAt, + orderDescending: true, + ); } - Future> getAllVotes(Session session) async { - final rows = Vote.db.find(session, limit: 50); - return rows; + Future createVote(Session session) async { + final vote = await Vote.db.insertRow( + session, + Vote( + userId: Random().nextInt(122), + createdAt: DateTime.now(), + quoteId: Random().nextInt(122), + upvote: true)); + + return '${vote.id}'; + } + + Future sayHello(Session session) async { + return 'hello'; } } diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json deleted file mode 100644 index e5cbb31..0000000 --- a/wien_talks/wien_talks_server/migrations/20250816095813247/definition_project.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "moduleName": "wien_talks", - "tables": [], - "installedModules": [ - { - "module": "serverpod", - "version": "20240516151843329" - } - ], - "migrationApiVersion": 1 -} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816122625449/migration.json b/wien_talks/wien_talks_server/migrations/20250816122625449/migration.json deleted file mode 100644 index c35478a..0000000 --- a/wien_talks/wien_talks_server/migrations/20250816122625449/migration.json +++ /dev/null @@ -1,676 +0,0 @@ -{ - "actions": [ - { - "type": "createTable", - "createTable": { - "name": "quote", - "dartName": "Quote", - "module": "wien_talks", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('quote_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userId", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "text", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "authorName", - "columnType": 0, - "isNullable": true, - "dartType": "String?" - }, - { - "name": "lat", - "columnType": 3, - "isNullable": false, - "dartType": "double" - }, - { - "name": "long", - "columnType": 3, - "isNullable": false, - "dartType": "double" - }, - { - "name": "createdAt", - "columnType": 4, - "isNullable": false, - "dartType": "DateTime" - }, - { - "name": "visibility", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "upvotes", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "downvotes", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "tags", - "columnType": 8, - "isNullable": true, - "dartType": "List?" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "quote_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_auth_key", - "dartName": "AuthKey", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userId", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "hash", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "scopeNames", - "columnType": 8, - "isNullable": false, - "dartType": "List" - }, - { - "name": "method", - "columnType": 0, - "isNullable": false, - "dartType": "String" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_auth_key_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_auth_key_userId_idx", - "elements": [ - { - "type": 0, - "definition": "userId" - } - ], - "type": "btree", - "isUnique": false, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_email_auth", - "dartName": "EmailAuth", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userId", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "email", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "hash", - "columnType": 0, - "isNullable": false, - "dartType": "String" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_email_auth_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_email_auth_email", - "elements": [ - { - "type": 0, - "definition": "email" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_email_create_request", - "dartName": "EmailCreateAccountRequest", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userName", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "email", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "hash", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "verificationCode", - "columnType": 0, - "isNullable": false, - "dartType": "String" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_email_create_request_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_email_auth_create_account_request_idx", - "elements": [ - { - "type": 0, - "definition": "email" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_email_failed_sign_in", - "dartName": "EmailFailedSignIn", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "email", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "time", - "columnType": 4, - "isNullable": false, - "dartType": "DateTime" - }, - { - "name": "ipAddress", - "columnType": 0, - "isNullable": false, - "dartType": "String" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_email_failed_sign_in_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_email_failed_sign_in_email_idx", - "elements": [ - { - "type": 0, - "definition": "email" - } - ], - "type": "btree", - "isUnique": false, - "isPrimary": false - }, - { - "indexName": "serverpod_email_failed_sign_in_time_idx", - "elements": [ - { - "type": 0, - "definition": "time" - } - ], - "type": "btree", - "isUnique": false, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_email_reset", - "dartName": "EmailReset", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userId", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "verificationCode", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "expiration", - "columnType": 4, - "isNullable": false, - "dartType": "DateTime" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_email_reset_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_email_reset_verification_idx", - "elements": [ - { - "type": 0, - "definition": "verificationCode" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_google_refresh_token", - "dartName": "GoogleRefreshToken", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userId", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "refreshToken", - "columnType": 0, - "isNullable": false, - "dartType": "String" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_google_refresh_token_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_google_refresh_token_userId_idx", - "elements": [ - { - "type": 0, - "definition": "userId" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_user_image", - "dartName": "UserImage", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userId", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "version", - "columnType": 6, - "isNullable": false, - "dartType": "int" - }, - { - "name": "url", - "columnType": 0, - "isNullable": false, - "dartType": "String" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_user_image_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_user_image_user_id", - "elements": [ - { - "type": 0, - "definition": "userId" - }, - { - "type": 0, - "definition": "version" - } - ], - "type": "btree", - "isUnique": false, - "isPrimary": false - } - ], - "managed": true - } - }, - { - "type": "createTable", - "createTable": { - "name": "serverpod_user_info", - "dartName": "UserInfo", - "module": "serverpod_auth", - "schema": "public", - "columns": [ - { - "name": "id", - "columnType": 6, - "isNullable": false, - "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", - "dartType": "int?" - }, - { - "name": "userIdentifier", - "columnType": 0, - "isNullable": false, - "dartType": "String" - }, - { - "name": "userName", - "columnType": 0, - "isNullable": true, - "dartType": "String?" - }, - { - "name": "fullName", - "columnType": 0, - "isNullable": true, - "dartType": "String?" - }, - { - "name": "email", - "columnType": 0, - "isNullable": true, - "dartType": "String?" - }, - { - "name": "created", - "columnType": 4, - "isNullable": false, - "dartType": "DateTime" - }, - { - "name": "imageUrl", - "columnType": 0, - "isNullable": true, - "dartType": "String?" - }, - { - "name": "scopeNames", - "columnType": 8, - "isNullable": false, - "dartType": "List" - }, - { - "name": "blocked", - "columnType": 1, - "isNullable": false, - "dartType": "bool" - } - ], - "foreignKeys": [], - "indexes": [ - { - "indexName": "serverpod_user_info_pkey", - "elements": [ - { - "type": 0, - "definition": "id" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": true - }, - { - "indexName": "serverpod_user_info_user_identifier", - "elements": [ - { - "type": 0, - "definition": "userIdentifier" - } - ], - "type": "btree", - "isUnique": true, - "isPrimary": false - }, - { - "indexName": "serverpod_user_info_email", - "elements": [ - { - "type": 0, - "definition": "email" - } - ], - "type": "btree", - "isUnique": false, - "isPrimary": false - } - ], - "managed": true - } - } - ], - "warnings": [], - "migrationApiVersion": 1 -} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816122625449/migration.sql b/wien_talks/wien_talks_server/migrations/20250816122625449/migration.sql deleted file mode 100644 index a0392e6..0000000 --- a/wien_talks/wien_talks_server/migrations/20250816122625449/migration.sql +++ /dev/null @@ -1,158 +0,0 @@ -BEGIN; - --- --- ACTION CREATE TABLE --- -CREATE TABLE "quote" ( - "id" bigserial PRIMARY KEY, - "userId" bigint NOT NULL, - "text" text NOT NULL, - "authorName" text, - "lat" double precision NOT NULL, - "long" double precision NOT NULL, - "createdAt" timestamp without time zone NOT NULL, - "visibility" bigint NOT NULL, - "upvotes" bigint NOT NULL, - "downvotes" bigint NOT NULL, - "tags" json -); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_auth_key" ( - "id" bigserial PRIMARY KEY, - "userId" bigint NOT NULL, - "hash" text NOT NULL, - "scopeNames" json NOT NULL, - "method" text NOT NULL -); - --- Indexes -CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_email_auth" ( - "id" bigserial PRIMARY KEY, - "userId" bigint NOT NULL, - "email" text NOT NULL, - "hash" text NOT NULL -); - --- Indexes -CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_email_create_request" ( - "id" bigserial PRIMARY KEY, - "userName" text NOT NULL, - "email" text NOT NULL, - "hash" text NOT NULL, - "verificationCode" text NOT NULL -); - --- Indexes -CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_email_failed_sign_in" ( - "id" bigserial PRIMARY KEY, - "email" text NOT NULL, - "time" timestamp without time zone NOT NULL, - "ipAddress" text NOT NULL -); - --- Indexes -CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); -CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_email_reset" ( - "id" bigserial PRIMARY KEY, - "userId" bigint NOT NULL, - "verificationCode" text NOT NULL, - "expiration" timestamp without time zone NOT NULL -); - --- Indexes -CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_google_refresh_token" ( - "id" bigserial PRIMARY KEY, - "userId" bigint NOT NULL, - "refreshToken" text NOT NULL -); - --- Indexes -CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_user_image" ( - "id" bigserial PRIMARY KEY, - "userId" bigint NOT NULL, - "version" bigint NOT NULL, - "url" text NOT NULL -); - --- Indexes -CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); - --- --- ACTION CREATE TABLE --- -CREATE TABLE "serverpod_user_info" ( - "id" bigserial PRIMARY KEY, - "userIdentifier" text NOT NULL, - "userName" text, - "fullName" text, - "email" text, - "created" timestamp without time zone NOT NULL, - "imageUrl" text, - "scopeNames" json NOT NULL, - "blocked" boolean NOT NULL -); - --- Indexes -CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); -CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); - - --- --- MIGRATION VERSION FOR wien_talks --- -INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('wien_talks', '20250816122625449', now()) - ON CONFLICT ("module") - DO UPDATE SET "version" = '20250816122625449', "timestamp" = now(); - --- --- MIGRATION VERSION FOR serverpod --- -INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('serverpod', '20240516151843329', now()) - ON CONFLICT ("module") - DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); - --- --- MIGRATION VERSION FOR serverpod_auth --- -INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('serverpod_auth', '20240520102713718', now()) - ON CONFLICT ("module") - DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); - - -COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/definition.json b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.json new file mode 100644 index 0000000..a90fc50 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.json @@ -0,0 +1,1855 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816212658542" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql new file mode 100644 index 0000000..391f78e --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql @@ -0,0 +1,405 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quote" json NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816212658542', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816212658542', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json new file mode 100644 index 0000000..a405534 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json @@ -0,0 +1,162 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/migration.json b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.json similarity index 62% rename from wien_talks/wien_talks_server/migrations/20250816095813247/migration.json rename to wien_talks/wien_talks_server/migrations/20250816212658542/migration.json index 9e98e44..3c6760d 100644 --- a/wien_talks/wien_talks_server/migrations/20250816095813247/migration.json +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.json @@ -1,5 +1,157 @@ { "actions": [ + { + "type": "createTable", + "createTable": { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, { "type": "createTable", "createTable": { @@ -1175,6 +1327,582 @@ ], "managed": true } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } } ], "warnings": [], diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.sql similarity index 63% rename from wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql rename to wien_talks/wien_talks_server/migrations/20250816212658542/migration.sql index 47258dd..4570684 100644 --- a/wien_talks/wien_talks_server/migrations/20250816095813247/migration.sql +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.sql @@ -1,5 +1,33 @@ BEGIN; +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quote" json NOT NULL, + "upvote" boolean NOT NULL +); + -- -- ACTION CREATE TABLE -- @@ -206,6 +234,118 @@ CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USI CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + -- -- ACTION CREATE FOREIGN KEY -- @@ -241,9 +381,9 @@ ALTER TABLE ONLY "serverpod_query_log" -- MIGRATION VERSION FOR wien_talks -- INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('wien_talks', '20250816095813247', now()) + VALUES ('wien_talks', '20250816212658542', now()) ON CONFLICT ("module") - DO UPDATE SET "version" = '20250816095813247', "timestamp" = now(); + DO UPDATE SET "version" = '20250816212658542', "timestamp" = now(); -- -- MIGRATION VERSION FOR serverpod @@ -253,5 +393,13 @@ INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") ON CONFLICT ("module") DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/definition.json b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.json new file mode 100644 index 0000000..2f07479 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.json @@ -0,0 +1,1855 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816212959541" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql new file mode 100644 index 0000000..e8fd79c --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql @@ -0,0 +1,405 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quote" json NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816212959541', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816212959541', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json new file mode 100644 index 0000000..a405534 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json @@ -0,0 +1,162 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816171653001/migration.json b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.json similarity index 100% rename from wien_talks/wien_talks_server/migrations/20250816171653001/migration.json rename to wien_talks/wien_talks_server/migrations/20250816212959541/migration.json diff --git a/wien_talks/wien_talks_server/migrations/20250816171653001/migration.sql b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.sql similarity index 85% rename from wien_talks/wien_talks_server/migrations/20250816171653001/migration.sql rename to wien_talks/wien_talks_server/migrations/20250816212959541/migration.sql index c1ccc46..17506d8 100644 --- a/wien_talks/wien_talks_server/migrations/20250816171653001/migration.sql +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.sql @@ -5,9 +5,9 @@ BEGIN; -- MIGRATION VERSION FOR wien_talks -- INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('wien_talks', '20250816171653001', now()) + VALUES ('wien_talks', '20250816212959541', now()) ON CONFLICT ("module") - DO UPDATE SET "version" = '20250816171653001', "timestamp" = now(); + DO UPDATE SET "version" = '20250816212959541', "timestamp" = now(); -- -- MIGRATION VERSION FOR serverpod diff --git a/wien_talks/wien_talks_server/migrations/20250816122625449/definition.json b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.json similarity index 97% rename from wien_talks/wien_talks_server/migrations/20250816122625449/definition.json rename to wien_talks/wien_talks_server/migrations/20250816214717668/definition.json index 025915f..d798718 100644 --- a/wien_talks/wien_talks_server/migrations/20250816122625449/definition.json +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.json @@ -92,6 +92,55 @@ ], "managed": true }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, { "name": "serverpod_cloud_storage", "dartName": "CloudStorageEntry", @@ -1785,7 +1834,7 @@ "installedModules": [ { "module": "wien_talks", - "version": "20250816122625449" + "version": "20250816214717668" }, { "module": "serverpod", diff --git a/wien_talks/wien_talks_server/migrations/20250816171653001/definition.sql b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.sql similarity index 97% rename from wien_talks/wien_talks_server/migrations/20250816171653001/definition.sql rename to wien_talks/wien_talks_server/migrations/20250816214717668/definition.sql index c3b22fd..5b0a366 100644 --- a/wien_talks/wien_talks_server/migrations/20250816171653001/definition.sql +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.sql @@ -17,6 +17,16 @@ CREATE TABLE "quote" ( "tags" json ); +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + -- -- Class CloudStorageEntry as table serverpod_cloud_storage -- @@ -370,9 +380,9 @@ ALTER TABLE ONLY "serverpod_query_log" -- MIGRATION VERSION FOR wien_talks -- INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('wien_talks', '20250816171653001', now()) + VALUES ('wien_talks', '20250816214717668', now()) ON CONFLICT ("module") - DO UPDATE SET "version" = '20250816171653001', "timestamp" = now(); + DO UPDATE SET "version" = '20250816214717668', "timestamp" = now(); -- -- MIGRATION VERSION FOR serverpod diff --git a/wien_talks/wien_talks_server/migrations/20250816122625449/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816214717668/definition_project.json similarity index 68% rename from wien_talks/wien_talks_server/migrations/20250816122625449/definition_project.json rename to wien_talks/wien_talks_server/migrations/20250816214717668/definition_project.json index d649d10..29120e1 100644 --- a/wien_talks/wien_talks_server/migrations/20250816122625449/definition_project.json +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/definition_project.json @@ -91,6 +91,55 @@ } ], "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true } ], "installedModules": [ diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/migration.json b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.json new file mode 100644 index 0000000..c267325 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.json @@ -0,0 +1,43 @@ +{ + "actions": [ + { + "type": "alterTable", + "alterTable": { + "name": "vote", + "schema": "public", + "addColumns": [], + "deleteColumns": [ + "quote" + ], + "modifyColumns": [], + "addIndexes": [], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [ + { + "type": "columnDropped", + "message": "Column \"quote\" of table \"vote\" will be dropped.", + "table": "vote", + "columns": [ + "quote" + ], + "destrucive": true + } + ] + } + } + ], + "warnings": [ + { + "type": "columnDropped", + "message": "Column \"quote\" of table \"vote\" will be dropped.", + "table": "vote", + "columns": [ + "quote" + ], + "destrucive": true + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql new file mode 100644 index 0000000..e6a6930 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql @@ -0,0 +1,33 @@ +BEGIN; + +-- +-- ACTION ALTER TABLE +-- +ALTER TABLE "vote" DROP COLUMN "quote"; + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816214717668', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816214717668', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816171653001/definition.json b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.json similarity index 97% rename from wien_talks/wien_talks_server/migrations/20250816171653001/definition.json rename to wien_talks/wien_talks_server/migrations/20250816215043551/definition.json index 9efa77a..ef49ab3 100644 --- a/wien_talks/wien_talks_server/migrations/20250816171653001/definition.json +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.json @@ -92,6 +92,55 @@ ], "managed": true }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, { "name": "serverpod_cloud_storage", "dartName": "CloudStorageEntry", @@ -1785,7 +1834,7 @@ "installedModules": [ { "module": "wien_talks", - "version": "20250816171653001" + "version": "20250816215043551" }, { "module": "serverpod", diff --git a/wien_talks/wien_talks_server/migrations/20250816122625449/definition.sql b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.sql similarity index 97% rename from wien_talks/wien_talks_server/migrations/20250816122625449/definition.sql rename to wien_talks/wien_talks_server/migrations/20250816215043551/definition.sql index 93fb32c..2f0363a 100644 --- a/wien_talks/wien_talks_server/migrations/20250816122625449/definition.sql +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.sql @@ -17,6 +17,16 @@ CREATE TABLE "quote" ( "tags" json ); +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + -- -- Class CloudStorageEntry as table serverpod_cloud_storage -- @@ -370,9 +380,9 @@ ALTER TABLE ONLY "serverpod_query_log" -- MIGRATION VERSION FOR wien_talks -- INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('wien_talks', '20250816122625449', now()) + VALUES ('wien_talks', '20250816215043551', now()) ON CONFLICT ("module") - DO UPDATE SET "version" = '20250816122625449', "timestamp" = now(); + DO UPDATE SET "version" = '20250816215043551', "timestamp" = now(); -- -- MIGRATION VERSION FOR serverpod diff --git a/wien_talks/wien_talks_server/migrations/20250816171653001/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816215043551/definition_project.json similarity index 68% rename from wien_talks/wien_talks_server/migrations/20250816171653001/definition_project.json rename to wien_talks/wien_talks_server/migrations/20250816215043551/definition_project.json index d649d10..29120e1 100644 --- a/wien_talks/wien_talks_server/migrations/20250816171653001/definition_project.json +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/definition_project.json @@ -91,6 +91,55 @@ } ], "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true } ], "installedModules": [ diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/migration.json b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql new file mode 100644 index 0000000..654d41e --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215043551', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215043551', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/definition.json b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.json similarity index 62% rename from wien_talks/wien_talks_server/migrations/20250816095813247/definition.json rename to wien_talks/wien_talks_server/migrations/20250816215049795/definition.json index 47337a1..7aba8ce 100644 --- a/wien_talks/wien_talks_server/migrations/20250816095813247/definition.json +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.json @@ -1,6 +1,146 @@ { "moduleName": "wien_talks", "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, { "name": "serverpod_cloud_storage", "dartName": "CloudStorageEntry", @@ -1137,16 +1277,572 @@ } ], "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true } ], "installedModules": [ { "module": "wien_talks", - "version": "20250816095813247" + "version": "20250816215049795" }, { "module": "serverpod", "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" } ], "migrationApiVersion": 1 diff --git a/wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.sql similarity index 63% rename from wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql rename to wien_talks/wien_talks_server/migrations/20250816215049795/definition.sql index a5506ab..fea42e4 100644 --- a/wien_talks/wien_talks_server/migrations/20250816095813247/definition.sql +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.sql @@ -1,5 +1,32 @@ BEGIN; +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + -- -- Class CloudStorageEntry as table serverpod_cloud_storage -- @@ -206,6 +233,118 @@ CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USI CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + -- -- Foreign relations for "serverpod_log" table -- @@ -241,9 +380,9 @@ ALTER TABLE ONLY "serverpod_query_log" -- MIGRATION VERSION FOR wien_talks -- INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") - VALUES ('wien_talks', '20250816095813247', now()) + VALUES ('wien_talks', '20250816215049795', now()) ON CONFLICT ("module") - DO UPDATE SET "version" = '20250816095813247', "timestamp" = now(); + DO UPDATE SET "version" = '20250816215049795', "timestamp" = now(); -- -- MIGRATION VERSION FOR serverpod @@ -253,5 +392,13 @@ INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") ON CONFLICT ("module") DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json new file mode 100644 index 0000000..29120e1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json @@ -0,0 +1,156 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/migration.json b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql new file mode 100644 index 0000000..327442d --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215049795', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215049795', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/definition.json b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.json new file mode 100644 index 0000000..6bc981d --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.json @@ -0,0 +1,1849 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816215102447" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql new file mode 100644 index 0000000..386eb66 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql @@ -0,0 +1,404 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215102447', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215102447', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json new file mode 100644 index 0000000..29120e1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json @@ -0,0 +1,156 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/migration.json b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql new file mode 100644 index 0000000..87e7234 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215102447', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215102447', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/definition.json b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.json new file mode 100644 index 0000000..15189fb --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.json @@ -0,0 +1,1898 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "health", + "dartName": "Health", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('health_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "health_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quoteId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816220051483" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql new file mode 100644 index 0000000..a916057 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql @@ -0,0 +1,414 @@ +BEGIN; + +-- +-- Class Health as table health +-- +CREATE TABLE "health" ( + "id" bigserial PRIMARY KEY, + "createdAt" timestamp without time zone NOT NULL, + "note" text +); + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quoteId" bigint NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816220051483', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816220051483', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json new file mode 100644 index 0000000..9bcbc1f --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json @@ -0,0 +1,205 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "health", + "dartName": "Health", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('health_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "health_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quoteId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/migration.json b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.json new file mode 100644 index 0000000..f940f22 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.json @@ -0,0 +1,124 @@ +{ + "actions": [ + { + "type": "createTable", + "createTable": { + "name": "health", + "dartName": "Health", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('health_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "health_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "deleteTable", + "deleteTable": "vote" + }, + { + "type": "createTable", + "createTable": { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quoteId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + } + ], + "warnings": [ + { + "type": "tableDropped", + "message": "One or more columns are added to table \"vote\" which cannot be added in a table migration. The complete table will be deleted and recreated.", + "table": "vote", + "columns": [ + "quoteId" + ], + "destrucive": true + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql new file mode 100644 index 0000000..72fd386 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql @@ -0,0 +1,54 @@ +BEGIN; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "health" ( + "id" bigserial PRIMARY KEY, + "createdAt" timestamp without time zone NOT NULL, + "note" text +); + +-- +-- ACTION DROP TABLE +-- +DROP TABLE "vote" CASCADE; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quoteId" bigint NOT NULL, + "upvote" boolean NOT NULL +); + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816220051483', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816220051483', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/migration_registry.txt b/wien_talks/wien_talks_server/migrations/migration_registry.txt index 106c539..a52cc5d 100644 --- a/wien_talks/wien_talks_server/migrations/migration_registry.txt +++ b/wien_talks/wien_talks_server/migrations/migration_registry.txt @@ -4,6 +4,10 @@ ### manually. If a collision is detected in this file when doing a code merge, resolve ### the conflict by removing and recreating the conflicting migration. -20250816095813247 -20250816122625449 -20250816171653001 +20250816212658542 +20250816212959541 +20250816214717668 +20250816215043551 +20250816215049795 +20250816215102447 +20250816220051483 diff --git a/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart b/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart index e2e9136..d4fe81d 100644 --- a/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart +++ b/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart @@ -14,11 +14,10 @@ import 'package:serverpod_test/serverpod_test.dart' as _i1; import 'package:serverpod/serverpod.dart' as _i2; import 'dart:async' as _i3; -import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i4; -import 'package:wien_talks_server/src/generated/quotes/create_quote.dart' - as _i5; -import 'package:wien_talks_server/src/generated/votes/vote.dart' as _i6; -import 'package:wien_talks_server/src/generated/votes/vote_request.dart' as _i7; +import 'package:wien_talks_server/src/generated/health.dart' as _i4; +import 'package:wien_talks_server/src/generated/quote.dart' as _i5; +import 'package:wien_talks_server/src/generated/create_quote.dart' as _i6; +import 'package:wien_talks_server/src/generated/vote.dart' as _i7; import 'package:wien_talks_server/src/generated/protocol.dart'; import 'package:wien_talks_server/src/generated/endpoints.dart'; export 'package:serverpod_test/serverpod_test_public_exports.dart'; @@ -105,6 +104,8 @@ void withServerpod( } class TestEndpoints { + late final _HealthEndpoint health; + late final _QuoteEndpoint quote; late final _VotesEndpoint votes; @@ -117,6 +118,10 @@ class _InternalTestEndpoints extends TestEndpoints _i2.SerializationManager serializationManager, _i2.EndpointDispatch endpoints, ) { + health = _HealthEndpoint( + endpoints, + serializationManager, + ); quote = _QuoteEndpoint( endpoints, serializationManager, @@ -128,6 +133,73 @@ class _InternalTestEndpoints extends TestEndpoints } } +class _HealthEndpoint { + _HealthEndpoint( + this._endpointDispatch, + this._serializationManager, + ); + + final _i2.EndpointDispatch _endpointDispatch; + + final _i2.SerializationManager _serializationManager; + + _i3.Future<_i4.Health> ping( + _i1.TestSessionBuilder sessionBuilder, { + String? note, + }) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'health', + method: 'ping', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'health', + methodName: 'ping', + parameters: _i1.testObjectToJson({'note': note}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future<_i4.Health>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future> all( + _i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'health', + method: 'all', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'health', + methodName: 'all', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } +} + class _QuoteEndpoint { _QuoteEndpoint( this._endpointDispatch, @@ -138,9 +210,35 @@ class _QuoteEndpoint { final _i2.SerializationManager _serializationManager; - _i3.Future<_i4.Quote> createQuote( + _i3.Future dbPing(_i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'quote', + method: 'dbPing', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'quote', + methodName: 'dbPing', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future<_i5.Quote> createQuote( _i1.TestSessionBuilder sessionBuilder, - _i5.CreateQuoteRequest req, + _i6.CreateQuoteRequest req, ) async { return _i1.callAwaitableFunctionAndHandleExceptions(() async { var _localUniqueSession = @@ -159,7 +257,7 @@ class _QuoteEndpoint { var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession, _localCallContext.arguments, - ) as _i3.Future<_i4.Quote>); + ) as _i3.Future<_i5.Quote>); return _localReturnValue; } finally { await _localUniqueSession.close(); @@ -169,7 +267,7 @@ class _QuoteEndpoint { _i3.Future updateQuote( _i1.TestSessionBuilder sessionBuilder, - _i4.Quote quote, + _i5.Quote quote, ) async { return _i1.callAwaitableFunctionAndHandleExceptions(() async { var _localUniqueSession = @@ -196,7 +294,7 @@ class _QuoteEndpoint { }); } - _i3.Future> getAllQuotes( + _i3.Future> getAllQuotes( _i1.TestSessionBuilder sessionBuilder) async { return _i1.callAwaitableFunctionAndHandleExceptions(() async { var _localUniqueSession = @@ -215,7 +313,7 @@ class _QuoteEndpoint { var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession, _localCallContext.arguments, - ) as _i3.Future>); + ) as _i3.Future>); return _localReturnValue; } finally { await _localUniqueSession.close(); @@ -234,36 +332,7 @@ class _VotesEndpoint { final _i2.SerializationManager _serializationManager; - _i3.Future<_i6.Vote> postVote( - _i1.TestSessionBuilder sessionBuilder, - _i7.VoteRequest voteRequest, - ) async { - return _i1.callAwaitableFunctionAndHandleExceptions(() async { - var _localUniqueSession = - (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( - endpoint: 'votes', - method: 'postVote', - ); - try { - var _localCallContext = await _endpointDispatch.getMethodCallContext( - createSessionCallback: (_) => _localUniqueSession, - endpointPath: 'votes', - methodName: 'postVote', - parameters: _i1.testObjectToJson({'voteRequest': voteRequest}), - serializationManager: _serializationManager, - ); - var _localReturnValue = await (_localCallContext.method.call( - _localUniqueSession, - _localCallContext.arguments, - ) as _i3.Future<_i6.Vote>); - return _localReturnValue; - } finally { - await _localUniqueSession.close(); - } - }); - } - - _i3.Future> getAllVotes( + _i3.Future> getAllVotes( _i1.TestSessionBuilder sessionBuilder) async { return _i1.callAwaitableFunctionAndHandleExceptions(() async { var _localUniqueSession = @@ -282,7 +351,59 @@ class _VotesEndpoint { var _localReturnValue = await (_localCallContext.method.call( _localUniqueSession, _localCallContext.arguments, - ) as _i3.Future>); + ) as _i3.Future>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future createVote(_i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'votes', + method: 'createVote', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'votes', + methodName: 'createVote', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future sayHello(_i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'votes', + method: 'sayHello', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'votes', + methodName: 'sayHello', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future); return _localReturnValue; } finally { await _localUniqueSession.close();