Compare commits

...

3 commits

Author SHA1 Message Date
tk
39e4f1142f restyle quote list 2025-08-17 01:10:22 +02:00
tk
595b4e730e resolved protocol resolution issue 2025-08-17 01:09:57 +02:00
tk
9219a04614 add auth skeleton 2025-08-17 01:09:57 +02:00
81 changed files with 13473 additions and 1497 deletions

View file

@ -11,13 +11,35 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_client/serverpod_client.dart' as _i1; import 'package:serverpod_client/serverpod_client.dart' as _i1;
import 'dart:async' as _i2; import 'dart:async' as _i2;
import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i3; import 'package:wien_talks_client/src/protocol/health.dart' as _i3;
import 'package:wien_talks_client/src/protocol/quotes/create_quote.dart' as _i4; import 'package:wien_talks_client/src/protocol/quote.dart' as _i4;
import 'package:wien_talks_client/src/protocol/votes/vote.dart' as _i5; import 'package:wien_talks_client/src/protocol/create_quote.dart' as _i5;
import 'package:wien_talks_client/src/protocol/votes/vote_request.dart' as _i6; import 'package:wien_talks_client/src/protocol/vote.dart' as _i6;
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i7; import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i7;
import 'protocol.dart' as _i8; 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<List<_i3.Health>> all() =>
caller.callServerEndpoint<List<_i3.Health>>(
'health',
'all',
{},
);
}
/// {@category Endpoint} /// {@category Endpoint}
class EndpointQuote extends _i1.EndpointRef { class EndpointQuote extends _i1.EndpointRef {
EndpointQuote(_i1.EndpointCaller caller) : super(caller); EndpointQuote(_i1.EndpointCaller caller) : super(caller);
@ -25,22 +47,28 @@ class EndpointQuote extends _i1.EndpointRef {
@override @override
String get name => 'quote'; String get name => 'quote';
_i2.Future<_i3.Quote> createQuote(_i4.CreateQuoteRequest req) => _i2.Future<String> dbPing() => caller.callServerEndpoint<String>(
caller.callServerEndpoint<_i3.Quote>( 'quote',
'dbPing',
{},
);
_i2.Future<_i4.Quote> createQuote(_i5.CreateQuoteRequest req) =>
caller.callServerEndpoint<_i4.Quote>(
'quote', 'quote',
'createQuote', 'createQuote',
{'req': req}, {'req': req},
); );
_i2.Future<void> updateQuote(_i3.Quote quote) => _i2.Future<void> updateQuote(_i4.Quote quote) =>
caller.callServerEndpoint<void>( caller.callServerEndpoint<void>(
'quote', 'quote',
'updateQuote', 'updateQuote',
{'quote': quote}, {'quote': quote},
); );
_i2.Future<List<_i3.Quote>> getAllQuotes() => _i2.Future<List<_i4.Quote>> getAllQuotes() =>
caller.callServerEndpoint<List<_i3.Quote>>( caller.callServerEndpoint<List<_i4.Quote>>(
'quote', 'quote',
'getAllQuotes', 'getAllQuotes',
{}, {},
@ -54,19 +82,24 @@ class EndpointVotes extends _i1.EndpointRef {
@override @override
String get name => 'votes'; String get name => 'votes';
_i2.Future<_i5.Vote> postVote(_i6.VoteRequest voteRequest) => _i2.Future<List<_i6.Vote>> getAllVotes() =>
caller.callServerEndpoint<_i5.Vote>( caller.callServerEndpoint<List<_i6.Vote>>(
'votes',
'postVote',
{'voteRequest': voteRequest},
);
_i2.Future<List<_i5.Vote>> getAllVotes() =>
caller.callServerEndpoint<List<_i5.Vote>>(
'votes', 'votes',
'getAllVotes', 'getAllVotes',
{}, {},
); );
_i2.Future<String> createVote() => caller.callServerEndpoint<String>(
'votes',
'createVote',
{},
);
_i2.Future<String> sayHello() => caller.callServerEndpoint<String>(
'votes',
'sayHello',
{},
);
} }
class Modules { class Modules {
@ -103,11 +136,14 @@ class Client extends _i1.ServerpodClientShared {
disconnectStreamsOnLostInternetConnection: disconnectStreamsOnLostInternetConnection:
disconnectStreamsOnLostInternetConnection, disconnectStreamsOnLostInternetConnection,
) { ) {
health = EndpointHealth(this);
quote = EndpointQuote(this); quote = EndpointQuote(this);
votes = EndpointVotes(this); votes = EndpointVotes(this);
modules = Modules(this); modules = Modules(this);
} }
late final EndpointHealth health;
late final EndpointQuote quote; late final EndpointQuote quote;
late final EndpointVotes votes; late final EndpointVotes votes;
@ -116,6 +152,7 @@ class Client extends _i1.ServerpodClientShared {
@override @override
Map<String, _i1.EndpointRef> get endpointRefLookup => { Map<String, _i1.EndpointRef> get endpointRefLookup => {
'health': health,
'quote': quote, 'quote': quote,
'votes': votes, 'votes': votes,
}; };

View file

@ -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<String, dynamic> 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<String, dynamic> 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,
);
}
}

View file

@ -10,17 +10,18 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_client/serverpod_client.dart' as _i1; import 'package:serverpod_client/serverpod_client.dart' as _i1;
import 'quotes/create_quote.dart' as _i2; import 'create_quote.dart' as _i2;
import 'quotes/quote.dart' as _i3; import 'health.dart' as _i3;
import 'votes/vote.dart' as _i4; import 'quote.dart' as _i4;
import 'votes/vote_request.dart' as _i5; import 'vote.dart' as _i5;
import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i6; import 'package:wien_talks_client/src/protocol/health.dart' as _i6;
import 'package:wien_talks_client/src/protocol/votes/vote.dart' as _i7; import 'package:wien_talks_client/src/protocol/quote.dart' as _i7;
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i8; import 'package:wien_talks_client/src/protocol/vote.dart' as _i8;
export 'quotes/create_quote.dart'; import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i9;
export 'quotes/quote.dart'; export 'create_quote.dart';
export 'votes/vote.dart'; export 'health.dart';
export 'votes/vote_request.dart'; export 'quote.dart';
export 'vote.dart';
export 'client.dart'; export 'client.dart';
class Protocol extends _i1.SerializationManager { class Protocol extends _i1.SerializationManager {
@ -39,26 +40,26 @@ class Protocol extends _i1.SerializationManager {
if (t == _i2.CreateQuoteRequest) { if (t == _i2.CreateQuoteRequest) {
return _i2.CreateQuoteRequest.fromJson(data) as T; return _i2.CreateQuoteRequest.fromJson(data) as T;
} }
if (t == _i3.Quote) { if (t == _i3.Health) {
return _i3.Quote.fromJson(data) as T; return _i3.Health.fromJson(data) as T;
} }
if (t == _i4.Vote) { if (t == _i4.Quote) {
return _i4.Vote.fromJson(data) as T; return _i4.Quote.fromJson(data) as T;
} }
if (t == _i5.VoteRequest) { if (t == _i5.Vote) {
return _i5.VoteRequest.fromJson(data) as T; return _i5.Vote.fromJson(data) as T;
} }
if (t == _i1.getType<_i2.CreateQuoteRequest?>()) { if (t == _i1.getType<_i2.CreateQuoteRequest?>()) {
return (data != null ? _i2.CreateQuoteRequest.fromJson(data) : null) as T; return (data != null ? _i2.CreateQuoteRequest.fromJson(data) : null) as T;
} }
if (t == _i1.getType<_i3.Quote?>()) { if (t == _i1.getType<_i3.Health?>()) {
return (data != null ? _i3.Quote.fromJson(data) : null) as T; return (data != null ? _i3.Health.fromJson(data) : null) as T;
} }
if (t == _i1.getType<_i4.Vote?>()) { if (t == _i1.getType<_i4.Quote?>()) {
return (data != null ? _i4.Vote.fromJson(data) : null) as T; return (data != null ? _i4.Quote.fromJson(data) : null) as T;
} }
if (t == _i1.getType<_i5.VoteRequest?>()) { if (t == _i1.getType<_i5.Vote?>()) {
return (data != null ? _i5.VoteRequest.fromJson(data) : null) as T; return (data != null ? _i5.Vote.fromJson(data) : null) as T;
} }
if (t == _i1.getType<List<String>?>()) { if (t == _i1.getType<List<String>?>()) {
return (data != null return (data != null
@ -70,14 +71,18 @@ class Protocol extends _i1.SerializationManager {
? (data as List).map((e) => deserialize<String>(e)).toList() ? (data as List).map((e) => deserialize<String>(e)).toList()
: null) as T; : null) as T;
} }
if (t == List<_i6.Quote>) { if (t == List<_i6.Health>) {
return (data as List).map((e) => deserialize<_i6.Quote>(e)).toList() as T; return (data as List).map((e) => deserialize<_i6.Health>(e)).toList()
as T;
} }
if (t == List<_i7.Vote>) { if (t == List<_i7.Quote>) {
return (data as List).map((e) => deserialize<_i7.Vote>(e)).toList() as T; 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 { try {
return _i8.Protocol().deserialize<T>(data, t); return _i9.Protocol().deserialize<T>(data, t);
} on _i1.DeserializationTypeNotFoundException catch (_) {} } on _i1.DeserializationTypeNotFoundException catch (_) {}
return super.deserialize<T>(data, t); return super.deserialize<T>(data, t);
} }
@ -89,16 +94,16 @@ class Protocol extends _i1.SerializationManager {
if (data is _i2.CreateQuoteRequest) { if (data is _i2.CreateQuoteRequest) {
return 'CreateQuoteRequest'; return 'CreateQuoteRequest';
} }
if (data is _i3.Quote) { if (data is _i3.Health) {
return 'Health';
}
if (data is _i4.Quote) {
return 'Quote'; return 'Quote';
} }
if (data is _i4.Vote) { if (data is _i5.Vote) {
return 'Vote'; return 'Vote';
} }
if (data is _i5.VoteRequest) { className = _i9.Protocol().getClassNameForObject(data);
return 'VoteRequest';
}
className = _i8.Protocol().getClassNameForObject(data);
if (className != null) { if (className != null) {
return 'serverpod_auth.$className'; return 'serverpod_auth.$className';
} }
@ -114,18 +119,18 @@ class Protocol extends _i1.SerializationManager {
if (dataClassName == 'CreateQuoteRequest') { if (dataClassName == 'CreateQuoteRequest') {
return deserialize<_i2.CreateQuoteRequest>(data['data']); return deserialize<_i2.CreateQuoteRequest>(data['data']);
} }
if (dataClassName == 'Health') {
return deserialize<_i3.Health>(data['data']);
}
if (dataClassName == 'Quote') { if (dataClassName == 'Quote') {
return deserialize<_i3.Quote>(data['data']); return deserialize<_i4.Quote>(data['data']);
} }
if (dataClassName == 'Vote') { if (dataClassName == 'Vote') {
return deserialize<_i4.Vote>(data['data']); return deserialize<_i5.Vote>(data['data']);
}
if (dataClassName == 'VoteRequest') {
return deserialize<_i5.VoteRequest>(data['data']);
} }
if (dataClassName.startsWith('serverpod_auth.')) { if (dataClassName.startsWith('serverpod_auth.')) {
data['className'] = dataClassName.substring(15); data['className'] = dataClassName.substring(15);
return _i8.Protocol().deserializeByClassName(data); return _i9.Protocol().deserializeByClassName(data);
} }
return super.deserializeByClassName(data); return super.deserializeByClassName(data);
} }

View file

@ -10,14 +10,13 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod_client/serverpod_client.dart' as _i1; import 'package:serverpod_client/serverpod_client.dart' as _i1;
import '../quotes/quote.dart' as _i2;
abstract class Vote implements _i1.SerializableModel { abstract class Vote implements _i1.SerializableModel {
Vote._({ Vote._({
this.id, this.id,
required this.userId, required this.userId,
required this.createdAt, required this.createdAt,
required this.quote, required this.quoteId,
required this.upvote, required this.upvote,
}); });
@ -25,7 +24,7 @@ abstract class Vote implements _i1.SerializableModel {
int? id, int? id,
required int userId, required int userId,
required DateTime createdAt, required DateTime createdAt,
required _i2.Quote quote, required int quoteId,
required bool upvote, required bool upvote,
}) = _VoteImpl; }) = _VoteImpl;
@ -35,8 +34,7 @@ abstract class Vote implements _i1.SerializableModel {
userId: jsonSerialization['userId'] as int, userId: jsonSerialization['userId'] as int,
createdAt: createdAt:
_i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']),
quote: _i2.Quote.fromJson( quoteId: jsonSerialization['quoteId'] as int,
(jsonSerialization['quote'] as Map<String, dynamic>)),
upvote: jsonSerialization['upvote'] as bool, upvote: jsonSerialization['upvote'] as bool,
); );
} }
@ -50,7 +48,7 @@ abstract class Vote implements _i1.SerializableModel {
DateTime createdAt; DateTime createdAt;
_i2.Quote quote; int quoteId;
bool upvote; bool upvote;
@ -61,7 +59,7 @@ abstract class Vote implements _i1.SerializableModel {
int? id, int? id,
int? userId, int? userId,
DateTime? createdAt, DateTime? createdAt,
_i2.Quote? quote, int? quoteId,
bool? upvote, bool? upvote,
}); });
@override @override
@ -70,7 +68,7 @@ abstract class Vote implements _i1.SerializableModel {
if (id != null) 'id': id, if (id != null) 'id': id,
'userId': userId, 'userId': userId,
'createdAt': createdAt.toJson(), 'createdAt': createdAt.toJson(),
'quote': quote.toJson(), 'quoteId': quoteId,
'upvote': upvote, 'upvote': upvote,
}; };
} }
@ -88,13 +86,13 @@ class _VoteImpl extends Vote {
int? id, int? id,
required int userId, required int userId,
required DateTime createdAt, required DateTime createdAt,
required _i2.Quote quote, required int quoteId,
required bool upvote, required bool upvote,
}) : super._( }) : super._(
id: id, id: id,
userId: userId, userId: userId,
createdAt: createdAt, createdAt: createdAt,
quote: quote, quoteId: quoteId,
upvote: upvote, upvote: upvote,
); );
@ -106,14 +104,14 @@ class _VoteImpl extends Vote {
Object? id = _Undefined, Object? id = _Undefined,
int? userId, int? userId,
DateTime? createdAt, DateTime? createdAt,
_i2.Quote? quote, int? quoteId,
bool? upvote, bool? upvote,
}) { }) {
return Vote( return Vote(
id: id is int? ? id : this.id, id: id is int? ? id : this.id,
userId: userId ?? this.userId, userId: userId ?? this.userId,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
quote: quote ?? this.quote.copyWith(), quoteId: quoteId ?? this.quoteId,
upvote: upvote ?? this.upvote, upvote: upvote ?? this.upvote,
); );
} }

View file

@ -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<String, dynamic> jsonSerialization) {
return VoteRequest(
id: jsonSerialization['id'] as int?,
userId: jsonSerialization['userId'] as int,
quote: _i2.Quote.fromJson(
(jsonSerialization['quote'] as Map<String, dynamic>)),
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<String, dynamic> 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,
);
}
}

View file

@ -0,0 +1,30 @@
import 'package:google_sign_in/google_sign_in.dart';
class AuthService {
static final _google = GoogleSignIn.instance;
static AuthService? _instance;
AuthService._() {
_google.initialize();
}
factory AuthService() {
if (_instance != null) return _instance!;
_instance = AuthService._();
return _instance!;
}
static Stream<GoogleSignInAuthenticationEvent?> get onUserChanged =>
_google.authenticationEvents;
static Future<GoogleSignInAccount?> signIn() async {
try {
return await _google.authenticate();
} catch (_) {
return null;
}
}
static Future<void> signOut() => _google.disconnect();
}

View file

@ -10,7 +10,7 @@ class FunmapMgr {
late Client client; late Client client;
late final serverUrl; late final String serverUrl;
factory FunmapMgr() { factory FunmapMgr() {
if (_instance != null) return _instance!; if (_instance != null) return _instance!;
@ -26,9 +26,11 @@ class FunmapMgr {
// E.g. `flutter run --dart-define=SERVER_URL=https://api.example.com/` // E.g. `flutter run --dart-define=SERVER_URL=https://api.example.com/`
const serverUrlFromEnv = String.fromEnvironment('SERVER_URL'); const serverUrlFromEnv = String.fromEnvironment('SERVER_URL');
serverUrl = serverUrlFromEnv.isEmpty ? 'http://$localhost:8080/' : serverUrlFromEnv; serverUrl =
serverUrlFromEnv.isEmpty ? 'http://$localhost:8080/' : serverUrlFromEnv;
client = Client(serverUrl, connectionTimeout: const Duration(seconds: 5))..connectivityMonitor = FlutterConnectivityMonitor(); client = Client(serverUrl, connectionTimeout: const Duration(seconds: 5))
..connectivityMonitor = FlutterConnectivityMonitor();
client.openStreamingConnection(); client.openStreamingConnection();
} }

View file

@ -1,13 +1,15 @@
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:wien_talks_flutter/create_event_screen.dart'; import 'package:wien_talks_flutter/screens/create_event_screen.dart';
import 'package:wien_talks_flutter/home_screen.dart'; import 'package:wien_talks_flutter/screens/login_page.dart';
import 'package:wien_talks_flutter/screens/news_screen.dart';
final router = GoRouter( final router = GoRouter(
routes: [ routes: [
GoRoute(path: '/login', builder: (c, s) => const LoginScreen()),
GoRoute(path: '/', builder: (c, s) => NewsScreen()),
GoRoute( GoRoute(
path: '/', path: '/create_event',
builder: (context, state) => HomeScreen(), name: 'create_event',
), builder: (c, s) => CreateEventScreen()),
GoRoute(path: '/create_event', name: 'create_event', builder: (context, state) => CreateEventScreen()),
], ],
); );

View file

@ -35,7 +35,8 @@ class LocationMgr {
final SymbolCache symbolCache = FileSymbolCache(); final SymbolCache symbolCache = FileSymbolCache();
final JobRenderer jobRenderer = kIsWeb ? MapOnlineRendererWeb() : MapOnlineRenderer(); final JobRenderer jobRenderer =
kIsWeb ? MapOnlineRendererWeb() : MapOnlineRenderer();
final MarkerByItemDataStore markerDataStore = MarkerByItemDataStore(); final MarkerByItemDataStore markerDataStore = MarkerByItemDataStore();
@ -44,7 +45,7 @@ class LocationMgr {
return _instance!; return _instance!;
} }
LocationMgr._() {} LocationMgr._();
Future<String?> startup() async { Future<String?> startup() async {
serviceEnabled = await location.serviceEnabled(); serviceEnabled = await location.serviceEnabled();
@ -70,18 +71,23 @@ class LocationMgr {
); );
mapModel?.markerDataStores.add(markerDataStore); mapModel?.markerDataStores.add(markerDataStore);
viewModel = ViewModel(displayModel: displayModel); viewModel = ViewModel(displayModel: displayModel);
_subscription = location.onLocationChanged.listen((LocationData currentLocation) { _subscription =
location.onLocationChanged.listen((LocationData currentLocation) {
_lastLocationData = currentLocation; _lastLocationData = currentLocation;
if (currentLocation.latitude != null && currentLocation.longitude != null) { if (currentLocation.latitude != null &&
viewModel?.setMapViewPosition(currentLocation.latitude!, currentLocation.longitude!); currentLocation.longitude != null) {
viewModel?.setMapViewPosition(
currentLocation.latitude!, currentLocation.longitude!);
if (iconMarker == null) { if (iconMarker == null) {
iconMarker ??= IconMarker( iconMarker ??= IconMarker(
fontSize: 30, fontSize: 30,
icon: Icons.gps_fixed, icon: Icons.gps_fixed,
color: Colors.red, color: Colors.red,
center: LatLong(currentLocation.latitude!, currentLocation.longitude!), center: LatLong(
currentLocation.latitude!, currentLocation.longitude!),
displayModel: displayModel); displayModel: displayModel);
mapModel?.markerDataStores.add(MarkerDataStore()..addMarker(iconMarker!)); mapModel?.markerDataStores
.add(MarkerDataStore()..addMarker(iconMarker!));
} }
} }
_subject.add(currentLocation); _subject.add(currentLocation);

View file

@ -1,6 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:mapsforge_flutter/core.dart'; import 'package:mapsforge_flutter/core.dart';
import 'package:wien_talks_flutter/location_mgr.dart'; import 'package:wien_talks_flutter/helper/location_mgr.dart';
class MapfileWidget extends StatefulWidget { class MapfileWidget extends StatefulWidget {
const MapfileWidget({super.key}); const MapfileWidget({super.key});

View file

@ -1,13 +1,13 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:location/location.dart'; import 'package:location/location.dart';
import 'package:wien_talks_client/wien_talks_client.dart'; import 'package:wien_talks_client/wien_talks_client.dart';
import 'package:wien_talks_flutter/get_location_widget.dart'; import 'package:wien_talks_flutter/widgets/get_location_widget.dart';
import 'package:wien_talks_flutter/helper/funmap_mgr.dart'; import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
import 'package:wien_talks_flutter/mapfile_widget.dart'; import 'package:wien_talks_flutter/mapfile_widget.dart';
import 'package:wien_talks_flutter/news_input_form.dart'; import 'package:wien_talks_flutter/widgets/news_input_form.dart';
import 'package:wien_talks_flutter/widgets/screen_widget.dart'; import 'package:wien_talks_flutter/widgets/screen_widget.dart';
import 'location_mgr.dart'; import '../helper/location_mgr.dart';
class CreateEventScreen extends StatelessWidget { class CreateEventScreen extends StatelessWidget {
const CreateEventScreen({super.key}); const CreateEventScreen({super.key});
@ -24,7 +24,11 @@ class CreateEventScreen extends StatelessWidget {
), ),
StreamBuilder( StreamBuilder(
stream: LocationMgr().stream, stream: LocationMgr().stream,
builder: (BuildContext context, AsyncSnapshot<LocationData> snapshot) => snapshot.data != null ? Text(snapshot.data.toString()) : SizedBox()), builder:
(BuildContext context, AsyncSnapshot<LocationData> snapshot) =>
snapshot.data != null
? Text(snapshot.data.toString())
: SizedBox()),
Expanded( Expanded(
child: GetLocationWidget( child: GetLocationWidget(
child: MapfileWidget(), child: MapfileWidget(),

View file

@ -1,11 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:wien_talks_flutter/helper/funmap_mgr.dart'; import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
import 'package:wien_talks_flutter/show_latest_news_widget.dart'; import 'package:wien_talks_flutter/screens/show_latest_news_widget.dart';
import 'package:wien_talks_flutter/widgets/intro_text_widget.dart'; import 'package:wien_talks_flutter/widgets/intro_text_widget.dart';
import 'package:wien_talks_flutter/widgets/screen_widget.dart'; import 'package:wien_talks_flutter/widgets/screen_widget.dart';
import 'carousel_widget.dart'; import '../widgets/carousel_widget.dart';
class HomeScreen extends StatelessWidget { class HomeScreen extends StatelessWidget {
const HomeScreen({ const HomeScreen({
@ -29,8 +29,10 @@ class HomeScreen extends StatelessWidget {
Expanded( Expanded(
child: ElevatedButton( child: ElevatedButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(Theme.of(context).primaryColor), backgroundColor: WidgetStateProperty.all(
foregroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.onPrimary)), Theme.of(context).primaryColor),
foregroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.onPrimary)),
onPressed: () { onPressed: () {
context.pushNamed("create_event"); context.pushNamed("create_event");
}, },
@ -45,7 +47,8 @@ class HomeScreen extends StatelessWidget {
Row( Row(
children: [ children: [
Spacer(), Spacer(),
Text(FunmapMgr().serverUrl, style: Theme.of(context).textTheme.bodySmall), Text(FunmapMgr().serverUrl,
style: Theme.of(context).textTheme.bodySmall),
], ],
) )
], ],

View file

@ -0,0 +1,50 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:wien_talks_flutter/helper/auth_service.dart';
class LoginScreen extends StatelessWidget {
const LoginScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xff2193b0), Color(0xff6dd5ed)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text('Wien Talks',
style: GoogleFonts.poppins(
fontSize: 42,
fontWeight: FontWeight.bold,
color: Colors.white)),
const SizedBox(height: 60),
FilledButton.icon(
onPressed: () async => await AuthService.signIn(),
style: FilledButton.styleFrom(
backgroundColor: Colors.white,
foregroundColor: Colors.black87,
padding:
const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
elevation: 6,
),
icon: Icon(
Icons.lock,
),
label: const Text('Sign in with Google'),
),
],
),
),
);
}
}

View file

@ -1,6 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:wien_talks_flutter/show_latest_news_widget.dart'; import 'package:wien_talks_flutter/screens/show_latest_news_widget.dart';
import 'package:wien_talks_flutter/widgets/heading_text.dart'; import 'package:wien_talks_flutter/widgets/heading_text.dart';
import 'package:wien_talks_flutter/widgets/screen_widget.dart'; import 'package:wien_talks_flutter/widgets/screen_widget.dart';
@ -16,7 +16,7 @@ class NewsScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
HeadingText(text: "Latest news"), HeadingText(text: "What's being said"),
ShowLatestNewsWidget(), ShowLatestNewsWidget(),
SizedBox( SizedBox(
height: 30, height: 30,

View file

@ -0,0 +1,143 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:wien_talks_client/wien_talks_client.dart';
import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
import 'package:wien_talks_flutter/widgets/quote_card.dart';
class ShowLatestNewsWidget extends StatefulWidget {
const ShowLatestNewsWidget({super.key});
@override
State<ShowLatestNewsWidget> createState() => _ShowLatestNewsWidgetState();
}
class _ShowLatestNewsWidgetState extends State<ShowLatestNewsWidget> {
List<Quote>? _quotes;
Object? _error;
bool _loading = true;
@override
void initState() {
super.initState();
_fetch();
}
Future<void> _fetch() async {
setState(() {
_loading = true;
_error = null;
});
try {
final list = await FunmapMgr().client.quote.getAllQuotes();
final quotes = list.whereType<Quote>().toList(growable: false);
quotes.sort((a, b) => (b.createdAt).compareTo(a.createdAt));
setState(() {
_quotes = quotes;
});
} catch (e) {
setState(() => _error = e);
} finally {
if (mounted) setState(() => _loading = false);
}
}
Future<void> _refresh() => _fetch();
Future<void> _vote(Quote quote, bool up) async {
if (_quotes == null) return;
final idx = _quotes!.indexWhere((q) => q.id == quote.id);
if (idx < 0) return;
final original = _quotes![idx];
final updated = original.copyWith(
upvotes: up ? original.upvotes + 1 : original.upvotes,
downvotes: up ? original.downvotes : original.downvotes + 1,
);
setState(() {
final copy = List<Quote>.from(_quotes!);
copy[idx] = updated;
_quotes = copy;
});
try {
await FunmapMgr().client.quote.updateQuote(updated);
} catch (e) {
setState(() {
final copy = List<Quote>.from(_quotes!);
copy[idx] = original;
_quotes = copy;
});
if (!mounted) return;
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Vote failed: $e')),
);
}
}
String _timeAgo(DateTime? dt) {
final d = (dt ?? DateTime.fromMillisecondsSinceEpoch(0)).toLocal();
final diff = DateTime.now().difference(d);
if (diff.inSeconds < 60) return 'just now';
if (diff.inMinutes < 60) return '${diff.inMinutes}m ago';
if (diff.inHours < 24) return '${diff.inHours}h ago';
if (diff.inDays < 7) return '${diff.inDays}d ago';
final m = d.month.toString().padLeft(2, '0');
final day = d.day.toString().padLeft(2, '0');
return '${d.year}-$m-$day';
}
@override
Widget build(BuildContext context) {
if (_loading) {
return const Center(child: CircularProgressIndicator());
}
if (_error != null) {
return Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Text('Error: $_error'),
),
);
}
final quotes = _quotes ?? const <Quote>[];
if (quotes.isEmpty) {
return const Center(child: Text('No quotes yet.'));
}
return LayoutBuilder(
builder: (context, constraints) {
final unboundedHeight = constraints.maxHeight == double.infinity;
final list = ListView.separated(
padding: const EdgeInsets.symmetric(vertical: 8),
shrinkWrap: unboundedHeight,
physics: unboundedHeight
? const NeverScrollableScrollPhysics()
: const AlwaysScrollableScrollPhysics(),
itemCount: quotes.length,
separatorBuilder: (_, __) => const SizedBox(height: 6),
itemBuilder: (context, i) {
final q = quotes[i];
final author = (q.authorName ?? '').trim();
final meta = [
if (author.isNotEmpty) author,
_timeAgo(q.createdAt),
].join(' · ');
return QuoteCard(
quote: q,
meta: meta,
onVoteUp: () => _vote(q, true),
onVoteDown: () => _vote(q, false),
);
},
);
if (unboundedHeight) return list;
return RefreshIndicator(onRefresh: _refresh, child: list);
},
);
}
}

View file

@ -1,57 +0,0 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:wien_talks_client/wien_talks_client.dart';
import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
class ShowLatestNewsWidget extends StatelessWidget {
const ShowLatestNewsWidget({super.key});
Future<List<Quote>> _load() async {
final list = await FunmapMgr().client.quote.getAllQuotes();
return list.whereType<Quote>().toList(growable: false);
}
@override
Widget build(BuildContext context) {
return FutureBuilder<List<Quote>>(
future: _load(),
builder: (context, snap) {
if (snap.connectionState != ConnectionState.done) {
return const Center(child: CircularProgressIndicator());
}
if (snap.hasError) {
return Center(
child: Padding(
padding: const EdgeInsets.all(16),
child: Text('Error: ${snap.error}'),
),
);
}
final quotes = snap.data ?? const <Quote>[];
if (quotes.isEmpty) {
return const Center(child: Text('No quotes yet.'));
}
return ListView.separated(
itemCount: quotes.length,
separatorBuilder: (_, __) => const Divider(height: 1),
itemBuilder: (context, i) {
final q = quotes[i];
final author = (q.authorName ?? '').trim();
final when = (q.createdAt ?? DateTime.fromMillisecondsSinceEpoch(0))
.toLocal()
.toString();
return ListTile(
title: Text(q.text),
subtitle: Text([
if (author.isNotEmpty) author,
when,
].join(' · ')),
);
},
);
},
);
}
}

View file

@ -1,5 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:wien_talks_flutter/location_mgr.dart'; import 'package:wien_talks_flutter/helper/location_mgr.dart';
class GetLocationWidget extends StatefulWidget { class GetLocationWidget extends StatefulWidget {
final Widget child; final Widget child;
@ -31,7 +31,8 @@ class _GetLocationWidgetState extends State<GetLocationWidget> {
{ {
if (snapshot.hasData) { if (snapshot.hasData) {
// Error occured // Error occured
return Text(snapshot.data.toString(), style: TextStyle(color: Colors.red)); return Text(snapshot.data.toString(),
style: TextStyle(color: Colors.red));
} else { } else {
return widget.child; return widget.child;
} }

View file

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:loader_overlay/loader_overlay.dart'; import 'package:loader_overlay/loader_overlay.dart';
import 'package:location/location.dart'; import 'package:location/location.dart';
import 'package:wien_talks_client/wien_talks_client.dart'; import 'package:wien_talks_client/wien_talks_client.dart';
import 'package:wien_talks_flutter/location_mgr.dart'; import 'package:wien_talks_flutter/helper/location_mgr.dart';
import 'package:wien_talks_flutter/widgets/error_snackbar.dart'; import 'package:wien_talks_flutter/widgets/error_snackbar.dart';
typedef OnSubmit = Future<void> Function(CreateQuoteRequest request); typedef OnSubmit = Future<void> Function(CreateQuoteRequest request);
@ -28,8 +28,11 @@ class _NewsInputFormState extends State<NewsInputForm> {
void _submitForm() async { void _submitForm() async {
LocationData? locationData = LocationMgr().lastLocation; LocationData? locationData = LocationMgr().lastLocation;
if (locationData == null || locationData.latitude == null || locationData.longitude == null) { if (locationData == null ||
ErrorSnackbar().show(context, "No location available, please retry later"); locationData.latitude == null ||
locationData.longitude == null) {
ErrorSnackbar()
.show(context, "No location available, please retry later");
return; return;
} }
if (_formKey.currentState!.validate()) { if (_formKey.currentState!.validate()) {
@ -79,8 +82,10 @@ class _NewsInputFormState extends State<NewsInputForm> {
const SizedBox(height: 16.0), const SizedBox(height: 16.0),
ElevatedButton( ElevatedButton(
style: ButtonStyle( style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(Theme.of(context).primaryColor), backgroundColor:
foregroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.onPrimary)), WidgetStateProperty.all(Theme.of(context).primaryColor),
foregroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.onPrimary)),
onPressed: _submitForm, onPressed: _submitForm,
child: const Text('Submit News'), child: const Text('Submit News'),
), ),

View file

@ -0,0 +1,121 @@
import 'package:flutter/material.dart';
import 'package:wien_talks_client/wien_talks_client.dart';
import 'package:wien_talks_flutter/widgets/vote_button.dart';
class QuoteCard extends StatefulWidget {
const QuoteCard({
super.key,
required this.quote,
required this.meta,
required this.onVoteUp,
required this.onVoteDown,
});
final Quote quote;
final String meta;
final VoidCallback onVoteUp;
final VoidCallback onVoteDown;
@override
State<QuoteCard> createState() => _QuoteCardState();
}
class _QuoteCardState extends State<QuoteCard> {
static const int _collapsedMaxLines = 4;
static const int _lengthHintForMore = 160;
bool _expanded = false;
@override
Widget build(BuildContext context) {
final t = Theme.of(context);
final baseSmall = t.textTheme.bodySmall;
final baseSmallColor = baseSmall?.color;
final metaColor = baseSmallColor?.withValues(alpha: 0.70);
final showMoreToggle = widget.quote.text.length > _lengthHintForMore;
return Card(
elevation: 1,
margin: const EdgeInsets.symmetric(horizontal: 12),
clipBehavior: Clip.antiAlias,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.quote.text,
style: t.textTheme.bodyLarge,
softWrap: true,
maxLines: _expanded ? null : _collapsedMaxLines,
overflow: _expanded
? TextOverflow.visible
: TextOverflow.ellipsis,
),
const SizedBox(height: 6),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Text(
widget.meta,
style: baseSmall?.copyWith(color: metaColor),
overflow: TextOverflow.ellipsis,
),
),
if (showMoreToggle) ...[
const SizedBox(width: 8),
TextButton(
onPressed: () =>
setState(() => _expanded = !_expanded),
style: TextButton.styleFrom(
padding: EdgeInsets.zero,
minimumSize: const Size(0, 0),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
child: Text(_expanded ? 'Less' : 'More'),
),
],
],
),
],
),
),
const SizedBox(width: 10),
ConstrainedBox(
constraints: const BoxConstraints.tightFor(width: 56),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// RailDivider(),
const SizedBox(height: 4),
//todo(timo) michi hauepl icon
VoteButton(
icon: Icons.arrow_upward,
semantics: 'Upvote',
count: widget.quote.upvotes,
onPressed: widget.onVoteUp,
color: t.colorScheme.primary,
),
const SizedBox(height: 4),
VoteButton(
icon: Icons.arrow_downward,
semantics: 'Downvote',
count: widget.quote.downvotes,
onPressed: widget.onVoteDown,
color: t.colorScheme.error,
),
],
),
),
],
),
),
);
}
}

View file

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
class RailDivider extends StatelessWidget {
const RailDivider({super.key});
@override
Widget build(BuildContext context) {
final c = Theme.of(context).dividerColor.withValues(alpha: 0.40);
return Container(
height: 18,
width: 1,
margin: const EdgeInsets.only(bottom: 6),
color: c,
alignment: Alignment.topRight,
);
}
}

View file

@ -0,0 +1,50 @@
import 'package:flutter/material.dart';
import 'package:wien_talks_client/wien_talks_client.dart';
class VoteButton extends StatelessWidget {
const VoteButton({
super.key,
required this.icon,
required this.semantics,
required this.count,
required this.onPressed,
required this.color,
});
final IconData icon;
final String semantics;
final int count;
final VoidCallback onPressed;
final Color color;
@override
Widget build(BuildContext context) {
final t = Theme.of(context);
return Column(
children: [
IconButton(
onPressed: onPressed,
icon: Icon(icon),
tooltip: semantics,
color: color,
iconSize: 20,
constraints: const BoxConstraints.tightFor(width: 36, height: 36),
padding: EdgeInsets.zero,
splashRadius: 20,
visualDensity: VisualDensity.compact,
),
AnimatedSwitcher(
duration: const Duration(milliseconds: 150),
transitionBuilder: (child, anim) =>
ScaleTransition(scale: anim, child: child),
child: Text(
'$count',
key: ValueKey(count),
style: t.textTheme.labelSmall,
textAlign: TextAlign.center,
),
),
],
);
}
}

View file

@ -23,14 +23,13 @@ DEPLOY_NETWORK = docker-net
.PHONY: local local-env local-stop local-down local-clean .PHONY: local local-env local-stop local-down local-clean
local: .env local: .env
docker compose -f $(COMPOSE_FILE_LOCAL) up -d docker compose -f $(COMPOSE_FILE_LOCAL) up -d
local-env: .env local-env: .env
local-stop: local-stop:
docker compose -f $(COMPOSE_FILE_LOCAL) stop docker compose -f $(COMPOSE_FILE_LOCAL) stop
local-down: local-down:
docker compose -f $(COMPOSE_FILE_LOCAL) down docker compose -f $(COMPOSE_FILE_LOCAL) down -v
local-clean: local-down local-clean: local-down
for VOLUME in $(shell docker compose -f $(COMPOSE_FILE_LOCAL) volumes -q); \ for VOLUME in $(shell docker compose -f $(COMPOSE_FILE_LOCAL) volumes -q); \
@ -66,3 +65,12 @@ deploy-clean: deploy-down
if test -n "$$(docker network ls -q --filter name=$(DEPLOY_NETWORK))"; then \ if test -n "$$(docker network ls -q --filter name=$(DEPLOY_NETWORK))"; then \
docker network rm $(DEPLOY_NETWORK) > /dev/null; fi docker network rm $(DEPLOY_NETWORK) > /dev/null; fi
codegen:
rm -rf lib/src/generated
serverpod generate
migrate:
dart run bin/main.dart --role maintenance --apply-migrations
recreate-db: local-down local codegen migrate
@echo "DB recreated & migrations applied."

View file

@ -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 // 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 // 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. // 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<String> args) async { void run(List<String> args) async {
// Initialize Serverpod and connect it with your generated code. // Initialize Serverpod and connect it with your generated code.
final pod = Serverpod( final pod = Serverpod(
args, args,
auth.Protocol(), Protocol(),
Endpoints(), Endpoints(),
authenticationHandler: auth.authenticationHandler, // authenticationHandler: authenticationHandler,
); );
// Setup a default page at the web root. // Setup a default page at the web root.

View file

@ -10,41 +10,88 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod/serverpod.dart' as _i1; import 'package:serverpod/serverpod.dart' as _i1;
import '../quotes/quotes_endpoint.dart' as _i2; import '../health/health-endpoint.dart' as _i2;
import '../votes/votes_endpoint.dart' as _i3; import '../quotes/quotes_endpoint.dart' as _i3;
import 'package:wien_talks_server/src/generated/quotes/create_quote.dart' import '../votes/votes_endpoint.dart' as _i4;
as _i4; import 'package:wien_talks_server/src/generated/create_quote.dart' as _i5;
import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i5; import 'package:wien_talks_server/src/generated/quote.dart' as _i6;
import 'package:wien_talks_server/src/generated/votes/vote_request.dart' as _i6;
import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i7; import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i7;
class Endpoints extends _i1.EndpointDispatch { class Endpoints extends _i1.EndpointDispatch {
@override @override
void initializeEndpoints(_i1.Server server) { void initializeEndpoints(_i1.Server server) {
var endpoints = <String, _i1.Endpoint>{ var endpoints = <String, _i1.Endpoint>{
'quote': _i2.QuoteEndpoint() 'health': _i2.HealthEndpoint()
..initialize(
server,
'health',
null,
),
'quote': _i3.QuoteEndpoint()
..initialize( ..initialize(
server, server,
'quote', 'quote',
null, null,
), ),
'votes': _i3.VotesEndpoint() 'votes': _i4.VotesEndpoint()
..initialize( ..initialize(
server, server,
'votes', 'votes',
null, 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<String?>(),
nullable: true,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['health'] as _i2.HealthEndpoint).ping(
session,
note: params['note'],
),
),
'all': _i1.MethodConnector(
name: 'all',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['health'] as _i2.HealthEndpoint).all(session),
),
},
);
connectors['quote'] = _i1.EndpointConnector( connectors['quote'] = _i1.EndpointConnector(
name: 'quote', name: 'quote',
endpoint: endpoints['quote']!, endpoint: endpoints['quote']!,
methodConnectors: { methodConnectors: {
'dbPing': _i1.MethodConnector(
name: 'dbPing',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['quote'] as _i3.QuoteEndpoint).dbPing(session),
),
'createQuote': _i1.MethodConnector( 'createQuote': _i1.MethodConnector(
name: 'createQuote', name: 'createQuote',
params: { params: {
'req': _i1.ParameterDescription( 'req': _i1.ParameterDescription(
name: 'req', name: 'req',
type: _i1.getType<_i4.CreateQuoteRequest>(), type: _i1.getType<_i5.CreateQuoteRequest>(),
nullable: false, nullable: false,
) )
}, },
@ -52,7 +99,7 @@ class Endpoints extends _i1.EndpointDispatch {
_i1.Session session, _i1.Session session,
Map<String, dynamic> params, Map<String, dynamic> params,
) async => ) async =>
(endpoints['quote'] as _i2.QuoteEndpoint).createQuote( (endpoints['quote'] as _i3.QuoteEndpoint).createQuote(
session, session,
params['req'], params['req'],
), ),
@ -62,7 +109,7 @@ class Endpoints extends _i1.EndpointDispatch {
params: { params: {
'quote': _i1.ParameterDescription( 'quote': _i1.ParameterDescription(
name: 'quote', name: 'quote',
type: _i1.getType<_i5.Quote>(), type: _i1.getType<_i6.Quote>(),
nullable: false, nullable: false,
) )
}, },
@ -70,7 +117,7 @@ class Endpoints extends _i1.EndpointDispatch {
_i1.Session session, _i1.Session session,
Map<String, dynamic> params, Map<String, dynamic> params,
) async => ) async =>
(endpoints['quote'] as _i2.QuoteEndpoint).updateQuote( (endpoints['quote'] as _i3.QuoteEndpoint).updateQuote(
session, session,
params['quote'], params['quote'],
), ),
@ -82,7 +129,7 @@ class Endpoints extends _i1.EndpointDispatch {
_i1.Session session, _i1.Session session,
Map<String, dynamic> params, Map<String, dynamic> params,
) async => ) 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', name: 'votes',
endpoint: endpoints['votes']!, endpoint: endpoints['votes']!,
methodConnectors: { methodConnectors: {
'postVote': _i1.MethodConnector(
name: 'postVote',
params: {
'voteRequest': _i1.ParameterDescription(
name: 'voteRequest',
type: _i1.getType<_i6.VoteRequest>(),
nullable: false,
)
},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['votes'] as _i3.VotesEndpoint).postVote(
session,
params['voteRequest'],
),
),
'getAllVotes': _i1.MethodConnector( 'getAllVotes': _i1.MethodConnector(
name: 'getAllVotes', name: 'getAllVotes',
params: {}, params: {},
@ -115,7 +144,25 @@ class Endpoints extends _i1.EndpointDispatch {
_i1.Session session, _i1.Session session,
Map<String, dynamic> params, Map<String, dynamic> params,
) async => ) 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<String, dynamic> params,
) async =>
(endpoints['votes'] as _i4.VotesEndpoint).createVote(session),
),
'sayHello': _i1.MethodConnector(
name: 'sayHello',
params: {},
call: (
_i1.Session session,
Map<String, dynamic> params,
) async =>
(endpoints['votes'] as _i4.VotesEndpoint).sayHello(session),
), ),
}, },
); );

View file

@ -10,66 +10,57 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod/serverpod.dart' as _i1; import 'package:serverpod/serverpod.dart' as _i1;
import '../quotes/quote.dart' as _i2;
abstract class VoteRequest abstract class Health implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
implements _i1.TableRow<int?>, _i1.ProtocolSerialization { Health._({
VoteRequest._({
this.id, this.id,
required this.userId, required this.createdAt,
required this.quote, this.note,
required this.upvote,
}); });
factory VoteRequest({ factory Health({
int? id, int? id,
required int userId, required DateTime createdAt,
required _i2.Quote quote, String? note,
required bool upvote, }) = _HealthImpl;
}) = _VoteRequestImpl;
factory VoteRequest.fromJson(Map<String, dynamic> jsonSerialization) { factory Health.fromJson(Map<String, dynamic> jsonSerialization) {
return VoteRequest( return Health(
id: jsonSerialization['id'] as int?, id: jsonSerialization['id'] as int?,
userId: jsonSerialization['userId'] as int, createdAt:
quote: _i2.Quote.fromJson( _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']),
(jsonSerialization['quote'] as Map<String, dynamic>)), note: jsonSerialization['note'] as String?,
upvote: jsonSerialization['upvote'] as bool,
); );
} }
static final t = VoteRequestTable(); static final t = HealthTable();
static const db = VoteRequestRepository._(); static const db = HealthRepository._();
@override @override
int? id; int? id;
int userId; DateTime createdAt;
_i2.Quote quote; String? note;
bool upvote;
@override @override
_i1.Table<int?> get table => t; _i1.Table<int?> 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. /// with some or all fields replaced by the given arguments.
@_i1.useResult @_i1.useResult
VoteRequest copyWith({ Health copyWith({
int? id, int? id,
int? userId, DateTime? createdAt,
_i2.Quote? quote, String? note,
bool? upvote,
}); });
@override @override
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
return { return {
if (id != null) 'id': id, if (id != null) 'id': id,
'userId': userId, 'createdAt': createdAt.toJson(),
'quote': quote.toJson(), if (note != null) 'note': note,
'upvote': upvote,
}; };
} }
@ -77,32 +68,31 @@ abstract class VoteRequest
Map<String, dynamic> toJsonForProtocol() { Map<String, dynamic> toJsonForProtocol() {
return { return {
if (id != null) 'id': id, if (id != null) 'id': id,
'userId': userId, 'createdAt': createdAt.toJson(),
'quote': quote.toJsonForProtocol(), if (note != null) 'note': note,
'upvote': upvote,
}; };
} }
static VoteRequestInclude include() { static HealthInclude include() {
return VoteRequestInclude._(); return HealthInclude._();
} }
static VoteRequestIncludeList includeList({ static HealthIncludeList includeList({
_i1.WhereExpressionBuilder<VoteRequestTable>? where, _i1.WhereExpressionBuilder<HealthTable>? where,
int? limit, int? limit,
int? offset, int? offset,
_i1.OrderByBuilder<VoteRequestTable>? orderBy, _i1.OrderByBuilder<HealthTable>? orderBy,
bool orderDescending = false, bool orderDescending = false,
_i1.OrderByListBuilder<VoteRequestTable>? orderByList, _i1.OrderByListBuilder<HealthTable>? orderByList,
VoteRequestInclude? include, HealthInclude? include,
}) { }) {
return VoteRequestIncludeList._( return HealthIncludeList._(
where: where, where: where,
limit: limit, limit: limit,
offset: offset, offset: offset,
orderBy: orderBy?.call(VoteRequest.t), orderBy: orderBy?.call(Health.t),
orderDescending: orderDescending, orderDescending: orderDescending,
orderByList: orderByList?.call(VoteRequest.t), orderByList: orderByList?.call(Health.t),
include: include, include: include,
); );
} }
@ -115,82 +105,71 @@ abstract class VoteRequest
class _Undefined {} class _Undefined {}
class _VoteRequestImpl extends VoteRequest { class _HealthImpl extends Health {
_VoteRequestImpl({ _HealthImpl({
int? id, int? id,
required int userId, required DateTime createdAt,
required _i2.Quote quote, String? note,
required bool upvote,
}) : super._( }) : super._(
id: id, id: id,
userId: userId, createdAt: createdAt,
quote: quote, note: note,
upvote: upvote,
); );
/// Returns a shallow copy of this [VoteRequest] /// Returns a shallow copy of this [Health]
/// with some or all fields replaced by the given arguments. /// with some or all fields replaced by the given arguments.
@_i1.useResult @_i1.useResult
@override @override
VoteRequest copyWith({ Health copyWith({
Object? id = _Undefined, Object? id = _Undefined,
int? userId, DateTime? createdAt,
_i2.Quote? quote, Object? note = _Undefined,
bool? upvote,
}) { }) {
return VoteRequest( return Health(
id: id is int? ? id : this.id, id: id is int? ? id : this.id,
userId: userId ?? this.userId, createdAt: createdAt ?? this.createdAt,
quote: quote ?? this.quote.copyWith(), note: note is String? ? note : this.note,
upvote: upvote ?? this.upvote,
); );
} }
} }
class VoteRequestTable extends _i1.Table<int?> { class HealthTable extends _i1.Table<int?> {
VoteRequestTable({super.tableRelation}) : super(tableName: 'vote_request') { HealthTable({super.tableRelation}) : super(tableName: 'health') {
userId = _i1.ColumnInt( createdAt = _i1.ColumnDateTime(
'userId', 'createdAt',
this, this,
); );
quote = _i1.ColumnSerializable( note = _i1.ColumnString(
'quote', 'note',
this,
);
upvote = _i1.ColumnBool(
'upvote',
this, this,
); );
} }
late final _i1.ColumnInt userId; late final _i1.ColumnDateTime createdAt;
late final _i1.ColumnSerializable quote; late final _i1.ColumnString note;
late final _i1.ColumnBool upvote;
@override @override
List<_i1.Column> get columns => [ List<_i1.Column> get columns => [
id, id,
userId, createdAt,
quote, note,
upvote,
]; ];
} }
class VoteRequestInclude extends _i1.IncludeObject { class HealthInclude extends _i1.IncludeObject {
VoteRequestInclude._(); HealthInclude._();
@override @override
Map<String, _i1.Include?> get includes => {}; Map<String, _i1.Include?> get includes => {};
@override @override
_i1.Table<int?> get table => VoteRequest.t; _i1.Table<int?> get table => Health.t;
} }
class VoteRequestIncludeList extends _i1.IncludeList { class HealthIncludeList extends _i1.IncludeList {
VoteRequestIncludeList._({ HealthIncludeList._({
_i1.WhereExpressionBuilder<VoteRequestTable>? where, _i1.WhereExpressionBuilder<HealthTable>? where,
super.limit, super.limit,
super.offset, super.offset,
super.orderBy, super.orderBy,
@ -198,20 +177,20 @@ class VoteRequestIncludeList extends _i1.IncludeList {
super.orderByList, super.orderByList,
super.include, super.include,
}) { }) {
super.where = where?.call(VoteRequest.t); super.where = where?.call(Health.t);
} }
@override @override
Map<String, _i1.Include?> get includes => include?.includes ?? {}; Map<String, _i1.Include?> get includes => include?.includes ?? {};
@override @override
_i1.Table<int?> get table => VoteRequest.t; _i1.Table<int?> get table => Health.t;
} }
class VoteRequestRepository { class HealthRepository {
const VoteRequestRepository._(); 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. /// Use [where] to specify which items to include in the return value.
/// If none is specified, all items will be returned. /// If none is specified, all items will be returned.
@ -233,20 +212,20 @@ class VoteRequestRepository {
/// limit: 100, /// limit: 100,
/// ); /// );
/// ``` /// ```
Future<List<VoteRequest>> find( Future<List<Health>> find(
_i1.Session session, { _i1.Session session, {
_i1.WhereExpressionBuilder<VoteRequestTable>? where, _i1.WhereExpressionBuilder<HealthTable>? where,
int? limit, int? limit,
int? offset, int? offset,
_i1.OrderByBuilder<VoteRequestTable>? orderBy, _i1.OrderByBuilder<HealthTable>? orderBy,
bool orderDescending = false, bool orderDescending = false,
_i1.OrderByListBuilder<VoteRequestTable>? orderByList, _i1.OrderByListBuilder<HealthTable>? orderByList,
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.find<VoteRequest>( return session.db.find<Health>(
where: where?.call(VoteRequest.t), where: where?.call(Health.t),
orderBy: orderBy?.call(VoteRequest.t), orderBy: orderBy?.call(Health.t),
orderByList: orderByList?.call(VoteRequest.t), orderByList: orderByList?.call(Health.t),
orderDescending: orderDescending, orderDescending: orderDescending,
limit: limit, limit: limit,
offset: offset, 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. /// Use [where] to specify which items to include in the return value.
/// If none is specified, all items will be returned. /// If none is specified, all items will be returned.
@ -271,136 +250,136 @@ class VoteRequestRepository {
/// orderBy: (t) => t.age, /// orderBy: (t) => t.age,
/// ); /// );
/// ``` /// ```
Future<VoteRequest?> findFirstRow( Future<Health?> findFirstRow(
_i1.Session session, { _i1.Session session, {
_i1.WhereExpressionBuilder<VoteRequestTable>? where, _i1.WhereExpressionBuilder<HealthTable>? where,
int? offset, int? offset,
_i1.OrderByBuilder<VoteRequestTable>? orderBy, _i1.OrderByBuilder<HealthTable>? orderBy,
bool orderDescending = false, bool orderDescending = false,
_i1.OrderByListBuilder<VoteRequestTable>? orderByList, _i1.OrderByListBuilder<HealthTable>? orderByList,
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.findFirstRow<VoteRequest>( return session.db.findFirstRow<Health>(
where: where?.call(VoteRequest.t), where: where?.call(Health.t),
orderBy: orderBy?.call(VoteRequest.t), orderBy: orderBy?.call(Health.t),
orderByList: orderByList?.call(VoteRequest.t), orderByList: orderByList?.call(Health.t),
orderDescending: orderDescending, orderDescending: orderDescending,
offset: offset, offset: offset,
transaction: transaction, transaction: transaction,
); );
} }
/// Finds a single [VoteRequest] by its [id] or null if no such row exists. /// Finds a single [Health] by its [id] or null if no such row exists.
Future<VoteRequest?> findById( Future<Health?> findById(
_i1.Session session, _i1.Session session,
int id, { int id, {
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.findById<VoteRequest>( return session.db.findById<Health>(
id, id,
transaction: transaction, 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 /// This is an atomic operation, meaning that if one of the rows fails to
/// insert, none of the rows will be inserted. /// insert, none of the rows will be inserted.
Future<List<VoteRequest>> insert( Future<List<Health>> insert(
_i1.Session session, _i1.Session session,
List<VoteRequest> rows, { List<Health> rows, {
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.insert<VoteRequest>( return session.db.insert<Health>(
rows, rows,
transaction: transaction, 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. /// The returned [Health] will have its `id` field set.
Future<VoteRequest> insertRow( Future<Health> insertRow(
_i1.Session session, _i1.Session session,
VoteRequest row, { Health row, {
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.insertRow<VoteRequest>( return session.db.insertRow<Health>(
row, row,
transaction: transaction, 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 /// [columns] is provided, only those columns will be updated. Defaults to
/// all columns. /// all columns.
/// This is an atomic operation, meaning that if one of the rows fails to /// This is an atomic operation, meaning that if one of the rows fails to
/// update, none of the rows will be updated. /// update, none of the rows will be updated.
Future<List<VoteRequest>> update( Future<List<Health>> update(
_i1.Session session, _i1.Session session,
List<VoteRequest> rows, { List<Health> rows, {
_i1.ColumnSelections<VoteRequestTable>? columns, _i1.ColumnSelections<HealthTable>? columns,
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.update<VoteRequest>( return session.db.update<Health>(
rows, rows,
columns: columns?.call(VoteRequest.t), columns: columns?.call(Health.t),
transaction: transaction, 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 /// Optionally, a list of [columns] can be provided to only update those
/// columns. Defaults to all columns. /// columns. Defaults to all columns.
Future<VoteRequest> updateRow( Future<Health> updateRow(
_i1.Session session, _i1.Session session,
VoteRequest row, { Health row, {
_i1.ColumnSelections<VoteRequestTable>? columns, _i1.ColumnSelections<HealthTable>? columns,
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.updateRow<VoteRequest>( return session.db.updateRow<Health>(
row, row,
columns: columns?.call(VoteRequest.t), columns: columns?.call(Health.t),
transaction: transaction, 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 /// This is an atomic operation, meaning that if one of the rows fail to
/// be deleted, none of the rows will be deleted. /// be deleted, none of the rows will be deleted.
Future<List<VoteRequest>> delete( Future<List<Health>> delete(
_i1.Session session, _i1.Session session,
List<VoteRequest> rows, { List<Health> rows, {
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.delete<VoteRequest>( return session.db.delete<Health>(
rows, rows,
transaction: transaction, transaction: transaction,
); );
} }
/// Deletes a single [VoteRequest]. /// Deletes a single [Health].
Future<VoteRequest> deleteRow( Future<Health> deleteRow(
_i1.Session session, _i1.Session session,
VoteRequest row, { Health row, {
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.deleteRow<VoteRequest>( return session.db.deleteRow<Health>(
row, row,
transaction: transaction, transaction: transaction,
); );
} }
/// Deletes all rows matching the [where] expression. /// Deletes all rows matching the [where] expression.
Future<List<VoteRequest>> deleteWhere( Future<List<Health>> deleteWhere(
_i1.Session session, { _i1.Session session, {
required _i1.WhereExpressionBuilder<VoteRequestTable> where, required _i1.WhereExpressionBuilder<HealthTable> where,
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.deleteWhere<VoteRequest>( return session.db.deleteWhere<Health>(
where: where(VoteRequest.t), where: where(Health.t),
transaction: transaction, transaction: transaction,
); );
} }
@ -409,12 +388,12 @@ class VoteRequestRepository {
/// will return the count of all rows in the table. /// will return the count of all rows in the table.
Future<int> count( Future<int> count(
_i1.Session session, { _i1.Session session, {
_i1.WhereExpressionBuilder<VoteRequestTable>? where, _i1.WhereExpressionBuilder<HealthTable>? where,
int? limit, int? limit,
_i1.Transaction? transaction, _i1.Transaction? transaction,
}) async { }) async {
return session.db.count<VoteRequest>( return session.db.count<Health>(
where: where?.call(VoteRequest.t), where: where?.call(Health.t),
limit: limit, limit: limit,
transaction: transaction, transaction: transaction,
); );

View file

@ -12,16 +12,17 @@
import 'package:serverpod/serverpod.dart' as _i1; import 'package:serverpod/serverpod.dart' as _i1;
import 'package:serverpod/protocol.dart' as _i2; import 'package:serverpod/protocol.dart' as _i2;
import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i3; import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i3;
import 'quotes/create_quote.dart' as _i4; import 'create_quote.dart' as _i4;
import 'quotes/quote.dart' as _i5; import 'health.dart' as _i5;
import 'votes/vote.dart' as _i6; import 'quote.dart' as _i6;
import 'votes/vote_request.dart' as _i7; import 'vote.dart' as _i7;
import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i8; import 'package:wien_talks_server/src/generated/health.dart' as _i8;
import 'package:wien_talks_server/src/generated/votes/vote.dart' as _i9; import 'package:wien_talks_server/src/generated/quote.dart' as _i9;
export 'quotes/create_quote.dart'; import 'package:wien_talks_server/src/generated/vote.dart' as _i10;
export 'quotes/quote.dart'; export 'create_quote.dart';
export 'votes/vote.dart'; export 'health.dart';
export 'votes/vote_request.dart'; export 'quote.dart';
export 'vote.dart';
class Protocol extends _i1.SerializationManagerServer { class Protocol extends _i1.SerializationManagerServer {
Protocol._(); Protocol._();
@ -31,6 +32,50 @@ class Protocol extends _i1.SerializationManagerServer {
static final Protocol _instance = Protocol._(); static final Protocol _instance = Protocol._();
static final List<_i2.TableDefinition> targetTableDefinitions = [ 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( _i2.TableDefinition(
name: 'quote', name: 'quote',
dartName: 'Quote', dartName: 'Quote',
@ -149,10 +194,10 @@ class Protocol extends _i1.SerializationManagerServer {
dartType: 'DateTime', dartType: 'DateTime',
), ),
_i2.ColumnDefinition( _i2.ColumnDefinition(
name: 'quote', name: 'quoteId',
columnType: _i2.ColumnType.json, columnType: _i2.ColumnType.bigint,
isNullable: false, isNullable: false,
dartType: 'protocol:Quote', dartType: 'int',
), ),
_i2.ColumnDefinition( _i2.ColumnDefinition(
name: 'upvote', name: 'upvote',
@ -179,56 +224,6 @@ class Protocol extends _i1.SerializationManagerServer {
], ],
managed: true, 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, ..._i3.Protocol.targetTableDefinitions,
..._i2.Protocol.targetTableDefinitions, ..._i2.Protocol.targetTableDefinitions,
]; ];
@ -242,26 +237,26 @@ class Protocol extends _i1.SerializationManagerServer {
if (t == _i4.CreateQuoteRequest) { if (t == _i4.CreateQuoteRequest) {
return _i4.CreateQuoteRequest.fromJson(data) as T; return _i4.CreateQuoteRequest.fromJson(data) as T;
} }
if (t == _i5.Quote) { if (t == _i5.Health) {
return _i5.Quote.fromJson(data) as T; return _i5.Health.fromJson(data) as T;
} }
if (t == _i6.Vote) { if (t == _i6.Quote) {
return _i6.Vote.fromJson(data) as T; return _i6.Quote.fromJson(data) as T;
} }
if (t == _i7.VoteRequest) { if (t == _i7.Vote) {
return _i7.VoteRequest.fromJson(data) as T; return _i7.Vote.fromJson(data) as T;
} }
if (t == _i1.getType<_i4.CreateQuoteRequest?>()) { if (t == _i1.getType<_i4.CreateQuoteRequest?>()) {
return (data != null ? _i4.CreateQuoteRequest.fromJson(data) : null) as T; return (data != null ? _i4.CreateQuoteRequest.fromJson(data) : null) as T;
} }
if (t == _i1.getType<_i5.Quote?>()) { if (t == _i1.getType<_i5.Health?>()) {
return (data != null ? _i5.Quote.fromJson(data) : null) as T; return (data != null ? _i5.Health.fromJson(data) : null) as T;
} }
if (t == _i1.getType<_i6.Vote?>()) { if (t == _i1.getType<_i6.Quote?>()) {
return (data != null ? _i6.Vote.fromJson(data) : null) as T; return (data != null ? _i6.Quote.fromJson(data) : null) as T;
} }
if (t == _i1.getType<_i7.VoteRequest?>()) { if (t == _i1.getType<_i7.Vote?>()) {
return (data != null ? _i7.VoteRequest.fromJson(data) : null) as T; return (data != null ? _i7.Vote.fromJson(data) : null) as T;
} }
if (t == _i1.getType<List<String>?>()) { if (t == _i1.getType<List<String>?>()) {
return (data != null return (data != null
@ -273,11 +268,15 @@ class Protocol extends _i1.SerializationManagerServer {
? (data as List).map((e) => deserialize<String>(e)).toList() ? (data as List).map((e) => deserialize<String>(e)).toList()
: null) as T; : null) as T;
} }
if (t == List<_i8.Quote>) { if (t == List<_i8.Health>) {
return (data as List).map((e) => deserialize<_i8.Quote>(e)).toList() as T; return (data as List).map((e) => deserialize<_i8.Health>(e)).toList()
as T;
} }
if (t == List<_i9.Vote>) { if (t == List<_i9.Quote>) {
return (data as List).map((e) => deserialize<_i9.Vote>(e)).toList() as T; 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 { try {
return _i3.Protocol().deserialize<T>(data, t); return _i3.Protocol().deserialize<T>(data, t);
@ -295,15 +294,15 @@ class Protocol extends _i1.SerializationManagerServer {
if (data is _i4.CreateQuoteRequest) { if (data is _i4.CreateQuoteRequest) {
return 'CreateQuoteRequest'; return 'CreateQuoteRequest';
} }
if (data is _i5.Quote) { if (data is _i5.Health) {
return 'Health';
}
if (data is _i6.Quote) {
return 'Quote'; return 'Quote';
} }
if (data is _i6.Vote) { if (data is _i7.Vote) {
return 'Vote'; return 'Vote';
} }
if (data is _i7.VoteRequest) {
return 'VoteRequest';
}
className = _i2.Protocol().getClassNameForObject(data); className = _i2.Protocol().getClassNameForObject(data);
if (className != null) { if (className != null) {
return 'serverpod.$className'; return 'serverpod.$className';
@ -324,14 +323,14 @@ class Protocol extends _i1.SerializationManagerServer {
if (dataClassName == 'CreateQuoteRequest') { if (dataClassName == 'CreateQuoteRequest') {
return deserialize<_i4.CreateQuoteRequest>(data['data']); return deserialize<_i4.CreateQuoteRequest>(data['data']);
} }
if (dataClassName == 'Health') {
return deserialize<_i5.Health>(data['data']);
}
if (dataClassName == 'Quote') { if (dataClassName == 'Quote') {
return deserialize<_i5.Quote>(data['data']); return deserialize<_i6.Quote>(data['data']);
} }
if (dataClassName == 'Vote') { if (dataClassName == 'Vote') {
return deserialize<_i6.Vote>(data['data']); return deserialize<_i7.Vote>(data['data']);
}
if (dataClassName == 'VoteRequest') {
return deserialize<_i7.VoteRequest>(data['data']);
} }
if (dataClassName.startsWith('serverpod.')) { if (dataClassName.startsWith('serverpod.')) {
data['className'] = dataClassName.substring(10); data['className'] = dataClassName.substring(10);
@ -359,12 +358,12 @@ class Protocol extends _i1.SerializationManagerServer {
} }
} }
switch (t) { switch (t) {
case _i5.Quote: case _i5.Health:
return _i5.Quote.t; return _i5.Health.t;
case _i6.Vote: case _i6.Quote:
return _i6.Vote.t; return _i6.Quote.t;
case _i7.VoteRequest: case _i7.Vote:
return _i7.VoteRequest.t; return _i7.Vote.t;
} }
return null; return null;
} }

View file

@ -1,7 +1,12 @@
health:
- ping:
- all:
quote: quote:
- dbPing:
- createQuote: - createQuote:
- updateQuote: - updateQuote:
- getAllQuotes: - getAllQuotes:
votes: votes:
- postVote:
- getAllVotes: - getAllVotes:
- createVote:
- sayHello:

View file

@ -10,14 +10,13 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes // ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:serverpod/serverpod.dart' as _i1; import 'package:serverpod/serverpod.dart' as _i1;
import '../quotes/quote.dart' as _i2;
abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization { abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
Vote._({ Vote._({
this.id, this.id,
required this.userId, required this.userId,
required this.createdAt, required this.createdAt,
required this.quote, required this.quoteId,
required this.upvote, required this.upvote,
}); });
@ -25,7 +24,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
int? id, int? id,
required int userId, required int userId,
required DateTime createdAt, required DateTime createdAt,
required _i2.Quote quote, required int quoteId,
required bool upvote, required bool upvote,
}) = _VoteImpl; }) = _VoteImpl;
@ -35,8 +34,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
userId: jsonSerialization['userId'] as int, userId: jsonSerialization['userId'] as int,
createdAt: createdAt:
_i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']),
quote: _i2.Quote.fromJson( quoteId: jsonSerialization['quoteId'] as int,
(jsonSerialization['quote'] as Map<String, dynamic>)),
upvote: jsonSerialization['upvote'] as bool, upvote: jsonSerialization['upvote'] as bool,
); );
} }
@ -52,7 +50,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
DateTime createdAt; DateTime createdAt;
_i2.Quote quote; int quoteId;
bool upvote; bool upvote;
@ -66,7 +64,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
int? id, int? id,
int? userId, int? userId,
DateTime? createdAt, DateTime? createdAt,
_i2.Quote? quote, int? quoteId,
bool? upvote, bool? upvote,
}); });
@override @override
@ -75,7 +73,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
if (id != null) 'id': id, if (id != null) 'id': id,
'userId': userId, 'userId': userId,
'createdAt': createdAt.toJson(), 'createdAt': createdAt.toJson(),
'quote': quote.toJson(), 'quoteId': quoteId,
'upvote': upvote, 'upvote': upvote,
}; };
} }
@ -86,7 +84,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
if (id != null) 'id': id, if (id != null) 'id': id,
'userId': userId, 'userId': userId,
'createdAt': createdAt.toJson(), 'createdAt': createdAt.toJson(),
'quote': quote.toJsonForProtocol(), 'quoteId': quoteId,
'upvote': upvote, 'upvote': upvote,
}; };
} }
@ -128,13 +126,13 @@ class _VoteImpl extends Vote {
int? id, int? id,
required int userId, required int userId,
required DateTime createdAt, required DateTime createdAt,
required _i2.Quote quote, required int quoteId,
required bool upvote, required bool upvote,
}) : super._( }) : super._(
id: id, id: id,
userId: userId, userId: userId,
createdAt: createdAt, createdAt: createdAt,
quote: quote, quoteId: quoteId,
upvote: upvote, upvote: upvote,
); );
@ -146,14 +144,14 @@ class _VoteImpl extends Vote {
Object? id = _Undefined, Object? id = _Undefined,
int? userId, int? userId,
DateTime? createdAt, DateTime? createdAt,
_i2.Quote? quote, int? quoteId,
bool? upvote, bool? upvote,
}) { }) {
return Vote( return Vote(
id: id is int? ? id : this.id, id: id is int? ? id : this.id,
userId: userId ?? this.userId, userId: userId ?? this.userId,
createdAt: createdAt ?? this.createdAt, createdAt: createdAt ?? this.createdAt,
quote: quote ?? this.quote.copyWith(), quoteId: quoteId ?? this.quoteId,
upvote: upvote ?? this.upvote, upvote: upvote ?? this.upvote,
); );
} }
@ -169,8 +167,8 @@ class VoteTable extends _i1.Table<int?> {
'createdAt', 'createdAt',
this, this,
); );
quote = _i1.ColumnSerializable( quoteId = _i1.ColumnInt(
'quote', 'quoteId',
this, this,
); );
upvote = _i1.ColumnBool( upvote = _i1.ColumnBool(
@ -183,7 +181,7 @@ class VoteTable extends _i1.Table<int?> {
late final _i1.ColumnDateTime createdAt; late final _i1.ColumnDateTime createdAt;
late final _i1.ColumnSerializable quote; late final _i1.ColumnInt quoteId;
late final _i1.ColumnBool upvote; late final _i1.ColumnBool upvote;
@ -192,7 +190,7 @@ class VoteTable extends _i1.Table<int?> {
id, id,
userId, userId,
createdAt, createdAt,
quote, quoteId,
upvote, upvote,
]; ];
} }

View file

@ -0,0 +1,23 @@
import 'package:serverpod/serverpod.dart';
import 'package:wien_talks_server/src/generated/protocol.dart';
class HealthEndpoint extends Endpoint {
Future<Health> ping(Session session, {String? note}) async {
final row = await Health.db.insertRow(
session,
Health(
createdAt: DateTime.now().toUtc(),
note: note,
),
);
return row;
}
Future<List<Health>> all(Session session) {
return Health.db.find(
session,
orderBy: (h) => h.createdAt,
orderDescending: true,
);
}
}

View file

@ -0,0 +1,5 @@
class: Health
table: health
fields:
createdAt: DateTime
note: String?

View file

@ -3,5 +3,5 @@ table: vote
fields: fields:
userId: int userId: int
createdAt: DateTime createdAt: DateTime
quote: Quote quoteId: int
upvote: bool upvote: bool

View file

@ -8,6 +8,13 @@ import 'package:wien_talks_server/src/quotes/quote_util.dart';
class QuoteEndpoint extends Endpoint { class QuoteEndpoint extends Endpoint {
static const _channelQuoteUpdates = 'quote-updates'; static const _channelQuoteUpdates = 'quote-updates';
Future<String> 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<Quote> createQuote(Session session, CreateQuoteRequest req) async { Future<Quote> createQuote(Session session, CreateQuoteRequest req) async {
final authInfo = await session.authenticated; final authInfo = await session.authenticated;
final userId = authInfo?.userId; final userId = authInfo?.userId;
@ -44,8 +51,8 @@ class QuoteEndpoint extends Endpoint {
final quoteList = await Quote.db.find( final quoteList = await Quote.db.find(
session, session,
// where: (t) => t.visibility.equals(0), // where: (t) => t.visibility.equals(0),
// orderBy: (t) => t.createdAt, orderBy: (t) => t.createdAt,
// orderDescending: true, orderDescending: true,
); );
for (var element in quoteList) { for (var element in quoteList) {

View file

@ -1,6 +0,0 @@
class: VoteRequest
table: vote_request
fields:
userId: int
quote: Quote
upvote: bool

View file

@ -1,21 +1,30 @@
import 'dart:math';
import 'package:serverpod/serverpod.dart'; import 'package:serverpod/serverpod.dart';
import 'package:wien_talks_server/src/generated/protocol.dart'; import 'package:wien_talks_server/src/generated/protocol.dart';
class VotesEndpoint extends Endpoint { class VotesEndpoint extends Endpoint {
Future<Vote> 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<List<Vote>> getAllVotes(Session session) async { Future<List<Vote>> getAllVotes(Session session) async {
final rows = Vote.db.find(session, limit: 50); return await Vote.db.find(
return rows; session,
orderBy: (v) => v.createdAt,
orderDescending: true,
);
}
Future<String> 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<String> sayHello(Session session) async {
return 'hello';
} }
} }

View file

@ -1,11 +0,0 @@
{
"moduleName": "wien_talks",
"tables": [],
"installedModules": [
{
"module": "serverpod",
"version": "20240516151843329"
}
],
"migrationApiVersion": 1
}

View file

@ -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<String>?"
}
],
"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<String>"
},
{
"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<String>"
},
{
"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
}

View file

@ -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;

File diff suppressed because it is too large Load diff

View file

@ -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;

View file

@ -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<String>?"
}
],
"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
}

View file

@ -1,5 +1,157 @@
{ {
"actions": [ "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<String>?"
}
],
"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", "type": "createTable",
"createTable": { "createTable": {
@ -1175,6 +1327,582 @@
], ],
"managed": 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<String>"
},
{
"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<String>"
},
{
"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": [], "warnings": [],

View file

@ -1,5 +1,33 @@
BEGIN; 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 -- 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_touched_idx" ON "serverpod_session_log" USING btree ("touched");
CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); 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 -- ACTION CREATE FOREIGN KEY
-- --
@ -241,9 +381,9 @@ ALTER TABLE ONLY "serverpod_query_log"
-- MIGRATION VERSION FOR wien_talks -- MIGRATION VERSION FOR wien_talks
-- --
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
VALUES ('wien_talks', '20250816095813247', now()) VALUES ('wien_talks', '20250816212658542', now())
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20250816095813247', "timestamp" = now(); DO UPDATE SET "version" = '20250816212658542', "timestamp" = now();
-- --
-- MIGRATION VERSION FOR serverpod -- MIGRATION VERSION FOR serverpod
@ -253,5 +393,13 @@ INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 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; COMMIT;

File diff suppressed because it is too large Load diff

View file

@ -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;

View file

@ -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<String>?"
}
],
"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
}

View file

@ -5,9 +5,9 @@ BEGIN;
-- MIGRATION VERSION FOR wien_talks -- MIGRATION VERSION FOR wien_talks
-- --
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
VALUES ('wien_talks', '20250816171653001', now()) VALUES ('wien_talks', '20250816212959541', now())
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20250816171653001', "timestamp" = now(); DO UPDATE SET "version" = '20250816212959541', "timestamp" = now();
-- --
-- MIGRATION VERSION FOR serverpod -- MIGRATION VERSION FOR serverpod

View file

@ -92,6 +92,55 @@
], ],
"managed": 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", "name": "serverpod_cloud_storage",
"dartName": "CloudStorageEntry", "dartName": "CloudStorageEntry",
@ -1785,7 +1834,7 @@
"installedModules": [ "installedModules": [
{ {
"module": "wien_talks", "module": "wien_talks",
"version": "20250816122625449" "version": "20250816214717668"
}, },
{ {
"module": "serverpod", "module": "serverpod",

View file

@ -17,6 +17,16 @@ CREATE TABLE "quote" (
"tags" json "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 -- Class CloudStorageEntry as table serverpod_cloud_storage
-- --
@ -370,9 +380,9 @@ ALTER TABLE ONLY "serverpod_query_log"
-- MIGRATION VERSION FOR wien_talks -- MIGRATION VERSION FOR wien_talks
-- --
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
VALUES ('wien_talks', '20250816171653001', now()) VALUES ('wien_talks', '20250816214717668', now())
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20250816171653001', "timestamp" = now(); DO UPDATE SET "version" = '20250816214717668', "timestamp" = now();
-- --
-- MIGRATION VERSION FOR serverpod -- MIGRATION VERSION FOR serverpod

View file

@ -91,6 +91,55 @@
} }
], ],
"managed": 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": [ "installedModules": [

View file

@ -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
}

View file

@ -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;

View file

@ -92,6 +92,55 @@
], ],
"managed": 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", "name": "serverpod_cloud_storage",
"dartName": "CloudStorageEntry", "dartName": "CloudStorageEntry",
@ -1785,7 +1834,7 @@
"installedModules": [ "installedModules": [
{ {
"module": "wien_talks", "module": "wien_talks",
"version": "20250816171653001" "version": "20250816215043551"
}, },
{ {
"module": "serverpod", "module": "serverpod",

View file

@ -17,6 +17,16 @@ CREATE TABLE "quote" (
"tags" json "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 -- Class CloudStorageEntry as table serverpod_cloud_storage
-- --
@ -370,9 +380,9 @@ ALTER TABLE ONLY "serverpod_query_log"
-- MIGRATION VERSION FOR wien_talks -- MIGRATION VERSION FOR wien_talks
-- --
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
VALUES ('wien_talks', '20250816122625449', now()) VALUES ('wien_talks', '20250816215043551', now())
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20250816122625449', "timestamp" = now(); DO UPDATE SET "version" = '20250816215043551', "timestamp" = now();
-- --
-- MIGRATION VERSION FOR serverpod -- MIGRATION VERSION FOR serverpod

View file

@ -91,6 +91,55 @@
} }
], ],
"managed": 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": [ "installedModules": [

View file

@ -0,0 +1,5 @@
{
"actions": [],
"warnings": [],
"migrationApiVersion": 1
}

View file

@ -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;

View file

@ -1,6 +1,146 @@
{ {
"moduleName": "wien_talks", "moduleName": "wien_talks",
"tables": [ "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<String>?"
}
],
"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", "name": "serverpod_cloud_storage",
"dartName": "CloudStorageEntry", "dartName": "CloudStorageEntry",
@ -1137,16 +1277,572 @@
} }
], ],
"managed": true "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<String>"
},
{
"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<String>"
},
{
"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": [ "installedModules": [
{ {
"module": "wien_talks", "module": "wien_talks",
"version": "20250816095813247" "version": "20250816215049795"
}, },
{ {
"module": "serverpod", "module": "serverpod",
"version": "20240516151843329" "version": "20240516151843329"
},
{
"module": "serverpod_auth",
"version": "20240520102713718"
} }
], ],
"migrationApiVersion": 1 "migrationApiVersion": 1

View file

@ -1,5 +1,32 @@
BEGIN; 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 -- 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_touched_idx" ON "serverpod_session_log" USING btree ("touched");
CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); 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 -- Foreign relations for "serverpod_log" table
-- --
@ -241,9 +380,9 @@ ALTER TABLE ONLY "serverpod_query_log"
-- MIGRATION VERSION FOR wien_talks -- MIGRATION VERSION FOR wien_talks
-- --
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
VALUES ('wien_talks', '20250816095813247', now()) VALUES ('wien_talks', '20250816215049795', now())
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20250816095813247', "timestamp" = now(); DO UPDATE SET "version" = '20250816215049795', "timestamp" = now();
-- --
-- MIGRATION VERSION FOR serverpod -- MIGRATION VERSION FOR serverpod
@ -253,5 +392,13 @@ INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
ON CONFLICT ("module") ON CONFLICT ("module")
DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); 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; COMMIT;

View file

@ -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<String>?"
}
],
"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
}

View file

@ -0,0 +1,5 @@
{
"actions": [],
"warnings": [],
"migrationApiVersion": 1
}

View file

@ -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;

File diff suppressed because it is too large Load diff

View file

@ -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;

View file

@ -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<String>?"
}
],
"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
}

View file

@ -0,0 +1,5 @@
{
"actions": [],
"warnings": [],
"migrationApiVersion": 1
}

View file

@ -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;

File diff suppressed because it is too large Load diff

View file

@ -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;

View file

@ -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<String>?"
}
],
"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
}

View file

@ -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
}

View file

@ -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;

View file

@ -4,6 +4,10 @@
### manually. If a collision is detected in this file when doing a code merge, resolve ### manually. If a collision is detected in this file when doing a code merge, resolve
### the conflict by removing and recreating the conflicting migration. ### the conflict by removing and recreating the conflicting migration.
20250816095813247 20250816212658542
20250816122625449 20250816212959541
20250816171653001 20250816214717668
20250816215043551
20250816215049795
20250816215102447
20250816220051483

View file

@ -14,11 +14,10 @@
import 'package:serverpod_test/serverpod_test.dart' as _i1; import 'package:serverpod_test/serverpod_test.dart' as _i1;
import 'package:serverpod/serverpod.dart' as _i2; import 'package:serverpod/serverpod.dart' as _i2;
import 'dart:async' as _i3; import 'dart:async' as _i3;
import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i4; import 'package:wien_talks_server/src/generated/health.dart' as _i4;
import 'package:wien_talks_server/src/generated/quotes/create_quote.dart' import 'package:wien_talks_server/src/generated/quote.dart' as _i5;
as _i5; import 'package:wien_talks_server/src/generated/create_quote.dart' as _i6;
import 'package:wien_talks_server/src/generated/votes/vote.dart' as _i6; import 'package:wien_talks_server/src/generated/vote.dart' as _i7;
import 'package:wien_talks_server/src/generated/votes/vote_request.dart' as _i7;
import 'package:wien_talks_server/src/generated/protocol.dart'; import 'package:wien_talks_server/src/generated/protocol.dart';
import 'package:wien_talks_server/src/generated/endpoints.dart'; import 'package:wien_talks_server/src/generated/endpoints.dart';
export 'package:serverpod_test/serverpod_test_public_exports.dart'; export 'package:serverpod_test/serverpod_test_public_exports.dart';
@ -105,6 +104,8 @@ void withServerpod(
} }
class TestEndpoints { class TestEndpoints {
late final _HealthEndpoint health;
late final _QuoteEndpoint quote; late final _QuoteEndpoint quote;
late final _VotesEndpoint votes; late final _VotesEndpoint votes;
@ -117,6 +118,10 @@ class _InternalTestEndpoints extends TestEndpoints
_i2.SerializationManager serializationManager, _i2.SerializationManager serializationManager,
_i2.EndpointDispatch endpoints, _i2.EndpointDispatch endpoints,
) { ) {
health = _HealthEndpoint(
endpoints,
serializationManager,
);
quote = _QuoteEndpoint( quote = _QuoteEndpoint(
endpoints, endpoints,
serializationManager, 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<List<_i4.Health>> 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<List<_i4.Health>>);
return _localReturnValue;
} finally {
await _localUniqueSession.close();
}
});
}
}
class _QuoteEndpoint { class _QuoteEndpoint {
_QuoteEndpoint( _QuoteEndpoint(
this._endpointDispatch, this._endpointDispatch,
@ -138,9 +210,35 @@ class _QuoteEndpoint {
final _i2.SerializationManager _serializationManager; final _i2.SerializationManager _serializationManager;
_i3.Future<_i4.Quote> createQuote( _i3.Future<String> 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<String>);
return _localReturnValue;
} finally {
await _localUniqueSession.close();
}
});
}
_i3.Future<_i5.Quote> createQuote(
_i1.TestSessionBuilder sessionBuilder, _i1.TestSessionBuilder sessionBuilder,
_i5.CreateQuoteRequest req, _i6.CreateQuoteRequest req,
) async { ) async {
return _i1.callAwaitableFunctionAndHandleExceptions(() async { return _i1.callAwaitableFunctionAndHandleExceptions(() async {
var _localUniqueSession = var _localUniqueSession =
@ -159,7 +257,7 @@ class _QuoteEndpoint {
var _localReturnValue = await (_localCallContext.method.call( var _localReturnValue = await (_localCallContext.method.call(
_localUniqueSession, _localUniqueSession,
_localCallContext.arguments, _localCallContext.arguments,
) as _i3.Future<_i4.Quote>); ) as _i3.Future<_i5.Quote>);
return _localReturnValue; return _localReturnValue;
} finally { } finally {
await _localUniqueSession.close(); await _localUniqueSession.close();
@ -169,7 +267,7 @@ class _QuoteEndpoint {
_i3.Future<void> updateQuote( _i3.Future<void> updateQuote(
_i1.TestSessionBuilder sessionBuilder, _i1.TestSessionBuilder sessionBuilder,
_i4.Quote quote, _i5.Quote quote,
) async { ) async {
return _i1.callAwaitableFunctionAndHandleExceptions(() async { return _i1.callAwaitableFunctionAndHandleExceptions(() async {
var _localUniqueSession = var _localUniqueSession =
@ -196,7 +294,7 @@ class _QuoteEndpoint {
}); });
} }
_i3.Future<List<_i4.Quote>> getAllQuotes( _i3.Future<List<_i5.Quote>> getAllQuotes(
_i1.TestSessionBuilder sessionBuilder) async { _i1.TestSessionBuilder sessionBuilder) async {
return _i1.callAwaitableFunctionAndHandleExceptions(() async { return _i1.callAwaitableFunctionAndHandleExceptions(() async {
var _localUniqueSession = var _localUniqueSession =
@ -215,7 +313,7 @@ class _QuoteEndpoint {
var _localReturnValue = await (_localCallContext.method.call( var _localReturnValue = await (_localCallContext.method.call(
_localUniqueSession, _localUniqueSession,
_localCallContext.arguments, _localCallContext.arguments,
) as _i3.Future<List<_i4.Quote>>); ) as _i3.Future<List<_i5.Quote>>);
return _localReturnValue; return _localReturnValue;
} finally { } finally {
await _localUniqueSession.close(); await _localUniqueSession.close();
@ -234,36 +332,7 @@ class _VotesEndpoint {
final _i2.SerializationManager _serializationManager; final _i2.SerializationManager _serializationManager;
_i3.Future<_i6.Vote> postVote( _i3.Future<List<_i7.Vote>> getAllVotes(
_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<List<_i6.Vote>> getAllVotes(
_i1.TestSessionBuilder sessionBuilder) async { _i1.TestSessionBuilder sessionBuilder) async {
return _i1.callAwaitableFunctionAndHandleExceptions(() async { return _i1.callAwaitableFunctionAndHandleExceptions(() async {
var _localUniqueSession = var _localUniqueSession =
@ -282,7 +351,59 @@ class _VotesEndpoint {
var _localReturnValue = await (_localCallContext.method.call( var _localReturnValue = await (_localCallContext.method.call(
_localUniqueSession, _localUniqueSession,
_localCallContext.arguments, _localCallContext.arguments,
) as _i3.Future<List<_i6.Vote>>); ) as _i3.Future<List<_i7.Vote>>);
return _localReturnValue;
} finally {
await _localUniqueSession.close();
}
});
}
_i3.Future<String> 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<String>);
return _localReturnValue;
} finally {
await _localUniqueSession.close();
}
});
}
_i3.Future<String> 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<String>);
return _localReturnValue; return _localReturnValue;
} finally { } finally {
await _localUniqueSession.close(); await _localUniqueSession.close();