mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-08 23:04:20 +01:00
Compare commits
No commits in common. "39e4f1142fef2195126723de60d0b0c75e47605c" and "cbc788b33e7c25a8b6626809199fae65b3c5314c" have entirely different histories.
39e4f1142f
...
cbc788b33e
81 changed files with 1498 additions and 13474 deletions
|
|
@ -11,35 +11,13 @@
|
|||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:serverpod_client/serverpod_client.dart' as _i1;
|
||||
import 'dart:async' as _i2;
|
||||
import 'package:wien_talks_client/src/protocol/health.dart' as _i3;
|
||||
import 'package:wien_talks_client/src/protocol/quote.dart' as _i4;
|
||||
import 'package:wien_talks_client/src/protocol/create_quote.dart' as _i5;
|
||||
import 'package:wien_talks_client/src/protocol/vote.dart' as _i6;
|
||||
import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i3;
|
||||
import 'package:wien_talks_client/src/protocol/quotes/create_quote.dart' as _i4;
|
||||
import 'package:wien_talks_client/src/protocol/votes/vote.dart' as _i5;
|
||||
import 'package:wien_talks_client/src/protocol/votes/vote_request.dart' as _i6;
|
||||
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i7;
|
||||
import 'protocol.dart' as _i8;
|
||||
|
||||
/// {@category Endpoint}
|
||||
class EndpointHealth extends _i1.EndpointRef {
|
||||
EndpointHealth(_i1.EndpointCaller caller) : super(caller);
|
||||
|
||||
@override
|
||||
String get name => 'health';
|
||||
|
||||
_i2.Future<_i3.Health> ping({String? note}) =>
|
||||
caller.callServerEndpoint<_i3.Health>(
|
||||
'health',
|
||||
'ping',
|
||||
{'note': note},
|
||||
);
|
||||
|
||||
_i2.Future<List<_i3.Health>> all() =>
|
||||
caller.callServerEndpoint<List<_i3.Health>>(
|
||||
'health',
|
||||
'all',
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
/// {@category Endpoint}
|
||||
class EndpointQuote extends _i1.EndpointRef {
|
||||
EndpointQuote(_i1.EndpointCaller caller) : super(caller);
|
||||
|
|
@ -47,28 +25,22 @@ class EndpointQuote extends _i1.EndpointRef {
|
|||
@override
|
||||
String get name => 'quote';
|
||||
|
||||
_i2.Future<String> dbPing() => caller.callServerEndpoint<String>(
|
||||
'quote',
|
||||
'dbPing',
|
||||
{},
|
||||
);
|
||||
|
||||
_i2.Future<_i4.Quote> createQuote(_i5.CreateQuoteRequest req) =>
|
||||
caller.callServerEndpoint<_i4.Quote>(
|
||||
_i2.Future<_i3.Quote> createQuote(_i4.CreateQuoteRequest req) =>
|
||||
caller.callServerEndpoint<_i3.Quote>(
|
||||
'quote',
|
||||
'createQuote',
|
||||
{'req': req},
|
||||
);
|
||||
|
||||
_i2.Future<void> updateQuote(_i4.Quote quote) =>
|
||||
_i2.Future<void> updateQuote(_i3.Quote quote) =>
|
||||
caller.callServerEndpoint<void>(
|
||||
'quote',
|
||||
'updateQuote',
|
||||
{'quote': quote},
|
||||
);
|
||||
|
||||
_i2.Future<List<_i4.Quote>> getAllQuotes() =>
|
||||
caller.callServerEndpoint<List<_i4.Quote>>(
|
||||
_i2.Future<List<_i3.Quote>> getAllQuotes() =>
|
||||
caller.callServerEndpoint<List<_i3.Quote>>(
|
||||
'quote',
|
||||
'getAllQuotes',
|
||||
{},
|
||||
|
|
@ -82,24 +54,19 @@ class EndpointVotes extends _i1.EndpointRef {
|
|||
@override
|
||||
String get name => 'votes';
|
||||
|
||||
_i2.Future<List<_i6.Vote>> getAllVotes() =>
|
||||
caller.callServerEndpoint<List<_i6.Vote>>(
|
||||
_i2.Future<_i5.Vote> postVote(_i6.VoteRequest voteRequest) =>
|
||||
caller.callServerEndpoint<_i5.Vote>(
|
||||
'votes',
|
||||
'postVote',
|
||||
{'voteRequest': voteRequest},
|
||||
);
|
||||
|
||||
_i2.Future<List<_i5.Vote>> getAllVotes() =>
|
||||
caller.callServerEndpoint<List<_i5.Vote>>(
|
||||
'votes',
|
||||
'getAllVotes',
|
||||
{},
|
||||
);
|
||||
|
||||
_i2.Future<String> createVote() => caller.callServerEndpoint<String>(
|
||||
'votes',
|
||||
'createVote',
|
||||
{},
|
||||
);
|
||||
|
||||
_i2.Future<String> sayHello() => caller.callServerEndpoint<String>(
|
||||
'votes',
|
||||
'sayHello',
|
||||
{},
|
||||
);
|
||||
}
|
||||
|
||||
class Modules {
|
||||
|
|
@ -136,14 +103,11 @@ class Client extends _i1.ServerpodClientShared {
|
|||
disconnectStreamsOnLostInternetConnection:
|
||||
disconnectStreamsOnLostInternetConnection,
|
||||
) {
|
||||
health = EndpointHealth(this);
|
||||
quote = EndpointQuote(this);
|
||||
votes = EndpointVotes(this);
|
||||
modules = Modules(this);
|
||||
}
|
||||
|
||||
late final EndpointHealth health;
|
||||
|
||||
late final EndpointQuote quote;
|
||||
|
||||
late final EndpointVotes votes;
|
||||
|
|
@ -152,7 +116,6 @@ class Client extends _i1.ServerpodClientShared {
|
|||
|
||||
@override
|
||||
Map<String, _i1.EndpointRef> get endpointRefLookup => {
|
||||
'health': health,
|
||||
'quote': quote,
|
||||
'votes': votes,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,96 +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;
|
||||
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -10,18 +10,17 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:serverpod_client/serverpod_client.dart' as _i1;
|
||||
import 'create_quote.dart' as _i2;
|
||||
import 'health.dart' as _i3;
|
||||
import 'quote.dart' as _i4;
|
||||
import 'vote.dart' as _i5;
|
||||
import 'package:wien_talks_client/src/protocol/health.dart' as _i6;
|
||||
import 'package:wien_talks_client/src/protocol/quote.dart' as _i7;
|
||||
import 'package:wien_talks_client/src/protocol/vote.dart' as _i8;
|
||||
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i9;
|
||||
export 'create_quote.dart';
|
||||
export 'health.dart';
|
||||
export 'quote.dart';
|
||||
export 'vote.dart';
|
||||
import 'quotes/create_quote.dart' as _i2;
|
||||
import 'quotes/quote.dart' as _i3;
|
||||
import 'votes/vote.dart' as _i4;
|
||||
import 'votes/vote_request.dart' as _i5;
|
||||
import 'package:wien_talks_client/src/protocol/quotes/quote.dart' as _i6;
|
||||
import 'package:wien_talks_client/src/protocol/votes/vote.dart' as _i7;
|
||||
import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i8;
|
||||
export 'quotes/create_quote.dart';
|
||||
export 'quotes/quote.dart';
|
||||
export 'votes/vote.dart';
|
||||
export 'votes/vote_request.dart';
|
||||
export 'client.dart';
|
||||
|
||||
class Protocol extends _i1.SerializationManager {
|
||||
|
|
@ -40,26 +39,26 @@ class Protocol extends _i1.SerializationManager {
|
|||
if (t == _i2.CreateQuoteRequest) {
|
||||
return _i2.CreateQuoteRequest.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i3.Health) {
|
||||
return _i3.Health.fromJson(data) as T;
|
||||
if (t == _i3.Quote) {
|
||||
return _i3.Quote.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i4.Quote) {
|
||||
return _i4.Quote.fromJson(data) as T;
|
||||
if (t == _i4.Vote) {
|
||||
return _i4.Vote.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i5.Vote) {
|
||||
return _i5.Vote.fromJson(data) as T;
|
||||
if (t == _i5.VoteRequest) {
|
||||
return _i5.VoteRequest.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i2.CreateQuoteRequest?>()) {
|
||||
return (data != null ? _i2.CreateQuoteRequest.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i3.Health?>()) {
|
||||
return (data != null ? _i3.Health.fromJson(data) : null) as T;
|
||||
if (t == _i1.getType<_i3.Quote?>()) {
|
||||
return (data != null ? _i3.Quote.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i4.Quote?>()) {
|
||||
return (data != null ? _i4.Quote.fromJson(data) : null) as T;
|
||||
if (t == _i1.getType<_i4.Vote?>()) {
|
||||
return (data != null ? _i4.Vote.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i5.Vote?>()) {
|
||||
return (data != null ? _i5.Vote.fromJson(data) : null) as T;
|
||||
if (t == _i1.getType<_i5.VoteRequest?>()) {
|
||||
return (data != null ? _i5.VoteRequest.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<List<String>?>()) {
|
||||
return (data != null
|
||||
|
|
@ -71,18 +70,14 @@ class Protocol extends _i1.SerializationManager {
|
|||
? (data as List).map((e) => deserialize<String>(e)).toList()
|
||||
: null) as T;
|
||||
}
|
||||
if (t == List<_i6.Health>) {
|
||||
return (data as List).map((e) => deserialize<_i6.Health>(e)).toList()
|
||||
as T;
|
||||
if (t == List<_i6.Quote>) {
|
||||
return (data as List).map((e) => deserialize<_i6.Quote>(e)).toList() as T;
|
||||
}
|
||||
if (t == List<_i7.Quote>) {
|
||||
return (data as List).map((e) => deserialize<_i7.Quote>(e)).toList() as T;
|
||||
}
|
||||
if (t == List<_i8.Vote>) {
|
||||
return (data as List).map((e) => deserialize<_i8.Vote>(e)).toList() as T;
|
||||
if (t == List<_i7.Vote>) {
|
||||
return (data as List).map((e) => deserialize<_i7.Vote>(e)).toList() as T;
|
||||
}
|
||||
try {
|
||||
return _i9.Protocol().deserialize<T>(data, t);
|
||||
return _i8.Protocol().deserialize<T>(data, t);
|
||||
} on _i1.DeserializationTypeNotFoundException catch (_) {}
|
||||
return super.deserialize<T>(data, t);
|
||||
}
|
||||
|
|
@ -94,16 +89,16 @@ class Protocol extends _i1.SerializationManager {
|
|||
if (data is _i2.CreateQuoteRequest) {
|
||||
return 'CreateQuoteRequest';
|
||||
}
|
||||
if (data is _i3.Health) {
|
||||
return 'Health';
|
||||
}
|
||||
if (data is _i4.Quote) {
|
||||
if (data is _i3.Quote) {
|
||||
return 'Quote';
|
||||
}
|
||||
if (data is _i5.Vote) {
|
||||
if (data is _i4.Vote) {
|
||||
return 'Vote';
|
||||
}
|
||||
className = _i9.Protocol().getClassNameForObject(data);
|
||||
if (data is _i5.VoteRequest) {
|
||||
return 'VoteRequest';
|
||||
}
|
||||
className = _i8.Protocol().getClassNameForObject(data);
|
||||
if (className != null) {
|
||||
return 'serverpod_auth.$className';
|
||||
}
|
||||
|
|
@ -119,18 +114,18 @@ class Protocol extends _i1.SerializationManager {
|
|||
if (dataClassName == 'CreateQuoteRequest') {
|
||||
return deserialize<_i2.CreateQuoteRequest>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'Health') {
|
||||
return deserialize<_i3.Health>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'Quote') {
|
||||
return deserialize<_i4.Quote>(data['data']);
|
||||
return deserialize<_i3.Quote>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'Vote') {
|
||||
return deserialize<_i5.Vote>(data['data']);
|
||||
return deserialize<_i4.Vote>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'VoteRequest') {
|
||||
return deserialize<_i5.VoteRequest>(data['data']);
|
||||
}
|
||||
if (dataClassName.startsWith('serverpod_auth.')) {
|
||||
data['className'] = dataClassName.substring(15);
|
||||
return _i9.Protocol().deserializeByClassName(data);
|
||||
return _i8.Protocol().deserializeByClassName(data);
|
||||
}
|
||||
return super.deserializeByClassName(data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:serverpod_client/serverpod_client.dart' as _i1;
|
||||
import '../quotes/quote.dart' as _i2;
|
||||
|
||||
abstract class Vote implements _i1.SerializableModel {
|
||||
Vote._({
|
||||
this.id,
|
||||
required this.userId,
|
||||
required this.createdAt,
|
||||
required this.quoteId,
|
||||
required this.quote,
|
||||
required this.upvote,
|
||||
});
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ abstract class Vote implements _i1.SerializableModel {
|
|||
int? id,
|
||||
required int userId,
|
||||
required DateTime createdAt,
|
||||
required int quoteId,
|
||||
required _i2.Quote quote,
|
||||
required bool upvote,
|
||||
}) = _VoteImpl;
|
||||
|
||||
|
|
@ -34,7 +35,8 @@ abstract class Vote implements _i1.SerializableModel {
|
|||
userId: jsonSerialization['userId'] as int,
|
||||
createdAt:
|
||||
_i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']),
|
||||
quoteId: jsonSerialization['quoteId'] as int,
|
||||
quote: _i2.Quote.fromJson(
|
||||
(jsonSerialization['quote'] as Map<String, dynamic>)),
|
||||
upvote: jsonSerialization['upvote'] as bool,
|
||||
);
|
||||
}
|
||||
|
|
@ -48,7 +50,7 @@ abstract class Vote implements _i1.SerializableModel {
|
|||
|
||||
DateTime createdAt;
|
||||
|
||||
int quoteId;
|
||||
_i2.Quote quote;
|
||||
|
||||
bool upvote;
|
||||
|
||||
|
|
@ -59,7 +61,7 @@ abstract class Vote implements _i1.SerializableModel {
|
|||
int? id,
|
||||
int? userId,
|
||||
DateTime? createdAt,
|
||||
int? quoteId,
|
||||
_i2.Quote? quote,
|
||||
bool? upvote,
|
||||
});
|
||||
@override
|
||||
|
|
@ -68,7 +70,7 @@ abstract class Vote implements _i1.SerializableModel {
|
|||
if (id != null) 'id': id,
|
||||
'userId': userId,
|
||||
'createdAt': createdAt.toJson(),
|
||||
'quoteId': quoteId,
|
||||
'quote': quote.toJson(),
|
||||
'upvote': upvote,
|
||||
};
|
||||
}
|
||||
|
|
@ -86,13 +88,13 @@ class _VoteImpl extends Vote {
|
|||
int? id,
|
||||
required int userId,
|
||||
required DateTime createdAt,
|
||||
required int quoteId,
|
||||
required _i2.Quote quote,
|
||||
required bool upvote,
|
||||
}) : super._(
|
||||
id: id,
|
||||
userId: userId,
|
||||
createdAt: createdAt,
|
||||
quoteId: quoteId,
|
||||
quote: quote,
|
||||
upvote: upvote,
|
||||
);
|
||||
|
||||
|
|
@ -104,14 +106,14 @@ class _VoteImpl extends Vote {
|
|||
Object? id = _Undefined,
|
||||
int? userId,
|
||||
DateTime? createdAt,
|
||||
int? quoteId,
|
||||
_i2.Quote? quote,
|
||||
bool? upvote,
|
||||
}) {
|
||||
return Vote(
|
||||
id: id is int? ? id : this.id,
|
||||
userId: userId ?? this.userId,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
quoteId: quoteId ?? this.quoteId,
|
||||
quote: quote ?? this.quote.copyWith(),
|
||||
upvote: upvote ?? this.upvote,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
/* 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:wien_talks_client/wien_talks_client.dart';
|
||||
import 'package:wien_talks_flutter/widgets/get_location_widget.dart';
|
||||
import 'package:wien_talks_flutter/get_location_widget.dart';
|
||||
import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
|
||||
import 'package:wien_talks_flutter/mapfile_widget.dart';
|
||||
import 'package:wien_talks_flutter/widgets/news_input_form.dart';
|
||||
import 'package:wien_talks_flutter/news_input_form.dart';
|
||||
import 'package:wien_talks_flutter/widgets/screen_widget.dart';
|
||||
|
||||
import '../helper/location_mgr.dart';
|
||||
import 'location_mgr.dart';
|
||||
|
||||
class CreateEventScreen extends StatelessWidget {
|
||||
const CreateEventScreen({super.key});
|
||||
|
|
@ -24,11 +24,7 @@ class CreateEventScreen extends StatelessWidget {
|
|||
),
|
||||
StreamBuilder(
|
||||
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(
|
||||
child: GetLocationWidget(
|
||||
child: MapfileWidget(),
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:wien_talks_flutter/helper/location_mgr.dart';
|
||||
import 'package:wien_talks_flutter/location_mgr.dart';
|
||||
|
||||
class GetLocationWidget extends StatefulWidget {
|
||||
final Widget child;
|
||||
|
|
@ -31,8 +31,7 @@ class _GetLocationWidgetState extends State<GetLocationWidget> {
|
|||
{
|
||||
if (snapshot.hasData) {
|
||||
// Error occured
|
||||
return Text(snapshot.data.toString(),
|
||||
style: TextStyle(color: Colors.red));
|
||||
return Text(snapshot.data.toString(), style: TextStyle(color: Colors.red));
|
||||
} else {
|
||||
return widget.child;
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ class FunmapMgr {
|
|||
|
||||
late Client client;
|
||||
|
||||
late final String serverUrl;
|
||||
late final serverUrl;
|
||||
|
||||
factory FunmapMgr() {
|
||||
if (_instance != null) return _instance!;
|
||||
|
|
@ -26,11 +26,9 @@ class FunmapMgr {
|
|||
// E.g. `flutter run --dart-define=SERVER_URL=https://api.example.com/`
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
import 'package:go_router/go_router.dart';
|
||||
import 'package:wien_talks_flutter/screens/create_event_screen.dart';
|
||||
import 'package:wien_talks_flutter/screens/login_page.dart';
|
||||
import 'package:wien_talks_flutter/screens/news_screen.dart';
|
||||
import 'package:wien_talks_flutter/create_event_screen.dart';
|
||||
import 'package:wien_talks_flutter/home_screen.dart';
|
||||
|
||||
final router = GoRouter(
|
||||
routes: [
|
||||
GoRoute(path: '/login', builder: (c, s) => const LoginScreen()),
|
||||
GoRoute(path: '/', builder: (c, s) => NewsScreen()),
|
||||
GoRoute(
|
||||
path: '/create_event',
|
||||
name: 'create_event',
|
||||
builder: (c, s) => CreateEventScreen()),
|
||||
path: '/',
|
||||
builder: (context, state) => HomeScreen(),
|
||||
),
|
||||
GoRoute(path: '/create_event', name: 'create_event', builder: (context, state) => CreateEventScreen()),
|
||||
],
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
|
||||
import 'package:wien_talks_flutter/screens/show_latest_news_widget.dart';
|
||||
import 'package:wien_talks_flutter/show_latest_news_widget.dart';
|
||||
import 'package:wien_talks_flutter/widgets/intro_text_widget.dart';
|
||||
import 'package:wien_talks_flutter/widgets/screen_widget.dart';
|
||||
|
||||
import '../widgets/carousel_widget.dart';
|
||||
import 'carousel_widget.dart';
|
||||
|
||||
class HomeScreen extends StatelessWidget {
|
||||
const HomeScreen({
|
||||
|
|
@ -29,10 +29,8 @@ class HomeScreen extends StatelessWidget {
|
|||
Expanded(
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.all(
|
||||
Theme.of(context).primaryColor),
|
||||
foregroundColor: WidgetStateProperty.all(
|
||||
Theme.of(context).colorScheme.onPrimary)),
|
||||
backgroundColor: WidgetStateProperty.all(Theme.of(context).primaryColor),
|
||||
foregroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.onPrimary)),
|
||||
onPressed: () {
|
||||
context.pushNamed("create_event");
|
||||
},
|
||||
|
|
@ -47,8 +45,7 @@ class HomeScreen extends StatelessWidget {
|
|||
Row(
|
||||
children: [
|
||||
Spacer(),
|
||||
Text(FunmapMgr().serverUrl,
|
||||
style: Theme.of(context).textTheme.bodySmall),
|
||||
Text(FunmapMgr().serverUrl, style: Theme.of(context).textTheme.bodySmall),
|
||||
],
|
||||
)
|
||||
],
|
||||
|
|
@ -35,8 +35,7 @@ class LocationMgr {
|
|||
|
||||
final SymbolCache symbolCache = FileSymbolCache();
|
||||
|
||||
final JobRenderer jobRenderer =
|
||||
kIsWeb ? MapOnlineRendererWeb() : MapOnlineRenderer();
|
||||
final JobRenderer jobRenderer = kIsWeb ? MapOnlineRendererWeb() : MapOnlineRenderer();
|
||||
|
||||
final MarkerByItemDataStore markerDataStore = MarkerByItemDataStore();
|
||||
|
||||
|
|
@ -45,7 +44,7 @@ class LocationMgr {
|
|||
return _instance!;
|
||||
}
|
||||
|
||||
LocationMgr._();
|
||||
LocationMgr._() {}
|
||||
|
||||
Future<String?> startup() async {
|
||||
serviceEnabled = await location.serviceEnabled();
|
||||
|
|
@ -71,23 +70,18 @@ class LocationMgr {
|
|||
);
|
||||
mapModel?.markerDataStores.add(markerDataStore);
|
||||
viewModel = ViewModel(displayModel: displayModel);
|
||||
_subscription =
|
||||
location.onLocationChanged.listen((LocationData currentLocation) {
|
||||
_subscription = location.onLocationChanged.listen((LocationData currentLocation) {
|
||||
_lastLocationData = currentLocation;
|
||||
if (currentLocation.latitude != null &&
|
||||
currentLocation.longitude != null) {
|
||||
viewModel?.setMapViewPosition(
|
||||
currentLocation.latitude!, currentLocation.longitude!);
|
||||
if (currentLocation.latitude != null && currentLocation.longitude != null) {
|
||||
viewModel?.setMapViewPosition(currentLocation.latitude!, currentLocation.longitude!);
|
||||
if (iconMarker == null) {
|
||||
iconMarker ??= IconMarker(
|
||||
fontSize: 30,
|
||||
icon: Icons.gps_fixed,
|
||||
color: Colors.red,
|
||||
center: LatLong(
|
||||
currentLocation.latitude!, currentLocation.longitude!),
|
||||
center: LatLong(currentLocation.latitude!, currentLocation.longitude!),
|
||||
displayModel: displayModel);
|
||||
mapModel?.markerDataStores
|
||||
.add(MarkerDataStore()..addMarker(iconMarker!));
|
||||
mapModel?.markerDataStores.add(MarkerDataStore()..addMarker(iconMarker!));
|
||||
}
|
||||
}
|
||||
_subject.add(currentLocation);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:mapsforge_flutter/core.dart';
|
||||
import 'package:wien_talks_flutter/helper/location_mgr.dart';
|
||||
import 'package:wien_talks_flutter/location_mgr.dart';
|
||||
|
||||
class MapfileWidget extends StatefulWidget {
|
||||
const MapfileWidget({super.key});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:loader_overlay/loader_overlay.dart';
|
||||
import 'package:location/location.dart';
|
||||
import 'package:wien_talks_client/wien_talks_client.dart';
|
||||
import 'package:wien_talks_flutter/helper/location_mgr.dart';
|
||||
import 'package:wien_talks_flutter/location_mgr.dart';
|
||||
import 'package:wien_talks_flutter/widgets/error_snackbar.dart';
|
||||
|
||||
typedef OnSubmit = Future<void> Function(CreateQuoteRequest request);
|
||||
|
|
@ -28,11 +28,8 @@ class _NewsInputFormState extends State<NewsInputForm> {
|
|||
|
||||
void _submitForm() async {
|
||||
LocationData? locationData = LocationMgr().lastLocation;
|
||||
if (locationData == null ||
|
||||
locationData.latitude == null ||
|
||||
locationData.longitude == null) {
|
||||
ErrorSnackbar()
|
||||
.show(context, "No location available, please retry later");
|
||||
if (locationData == null || locationData.latitude == null || locationData.longitude == null) {
|
||||
ErrorSnackbar().show(context, "No location available, please retry later");
|
||||
return;
|
||||
}
|
||||
if (_formKey.currentState!.validate()) {
|
||||
|
|
@ -82,10 +79,8 @@ class _NewsInputFormState extends State<NewsInputForm> {
|
|||
const SizedBox(height: 16.0),
|
||||
ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor:
|
||||
WidgetStateProperty.all(Theme.of(context).primaryColor),
|
||||
foregroundColor: WidgetStateProperty.all(
|
||||
Theme.of(context).colorScheme.onPrimary)),
|
||||
backgroundColor: WidgetStateProperty.all(Theme.of(context).primaryColor),
|
||||
foregroundColor: WidgetStateProperty.all(Theme.of(context).colorScheme.onPrimary)),
|
||||
onPressed: _submitForm,
|
||||
child: const Text('Submit News'),
|
||||
),
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:wien_talks_flutter/screens/show_latest_news_widget.dart';
|
||||
import 'package:wien_talks_flutter/show_latest_news_widget.dart';
|
||||
import 'package:wien_talks_flutter/widgets/heading_text.dart';
|
||||
import 'package:wien_talks_flutter/widgets/screen_widget.dart';
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class NewsScreen extends StatelessWidget {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
HeadingText(text: "What's being said"),
|
||||
HeadingText(text: "Latest news"),
|
||||
ShowLatestNewsWidget(),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
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'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,143 +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';
|
||||
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);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
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(' · ')),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -23,13 +23,14 @@ DEPLOY_NETWORK = docker-net
|
|||
.PHONY: local local-env local-stop local-down local-clean
|
||||
local: .env
|
||||
docker compose -f $(COMPOSE_FILE_LOCAL) up -d
|
||||
|
||||
local-env: .env
|
||||
|
||||
local-stop:
|
||||
docker compose -f $(COMPOSE_FILE_LOCAL) stop
|
||||
|
||||
local-down:
|
||||
docker compose -f $(COMPOSE_FILE_LOCAL) down -v
|
||||
docker compose -f $(COMPOSE_FILE_LOCAL) down
|
||||
|
||||
local-clean: local-down
|
||||
for VOLUME in $(shell docker compose -f $(COMPOSE_FILE_LOCAL) volumes -q); \
|
||||
|
|
@ -65,12 +66,3 @@ deploy-clean: deploy-down
|
|||
if test -n "$$(docker network ls -q --filter name=$(DEPLOY_NETWORK))"; then \
|
||||
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."
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
import 'package:serverpod/serverpod.dart';
|
||||
import 'package:serverpod_auth_server/serverpod_auth_server.dart' as auth;
|
||||
import 'package:wien_talks_server/src/web/routes/root.dart';
|
||||
|
||||
import 'src/generated/endpoints.dart';
|
||||
|
||||
// This is the starting point of your Serverpod server. In most cases, you will
|
||||
// only need to make additions to this file if you add future calls, are
|
||||
// configuring Relic (Serverpod's web-server), or need custom setup work.
|
||||
|
||||
import 'package:serverpod/serverpod.dart';
|
||||
|
||||
import 'src/generated/endpoints.dart';
|
||||
import 'src/generated/protocol.dart';
|
||||
import 'src/web/routes/root.dart';
|
||||
|
||||
void run(List<String> args) async {
|
||||
// Initialize Serverpod and connect it with your generated code.
|
||||
final pod = Serverpod(
|
||||
args,
|
||||
Protocol(),
|
||||
auth.Protocol(),
|
||||
Endpoints(),
|
||||
// authenticationHandler: authenticationHandler,
|
||||
authenticationHandler: auth.authenticationHandler,
|
||||
);
|
||||
|
||||
// Setup a default page at the web root.
|
||||
|
|
|
|||
|
|
@ -10,88 +10,41 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:serverpod/serverpod.dart' as _i1;
|
||||
import '../health/health-endpoint.dart' as _i2;
|
||||
import '../quotes/quotes_endpoint.dart' as _i3;
|
||||
import '../votes/votes_endpoint.dart' as _i4;
|
||||
import 'package:wien_talks_server/src/generated/create_quote.dart' as _i5;
|
||||
import 'package:wien_talks_server/src/generated/quote.dart' as _i6;
|
||||
import '../quotes/quotes_endpoint.dart' as _i2;
|
||||
import '../votes/votes_endpoint.dart' as _i3;
|
||||
import 'package:wien_talks_server/src/generated/quotes/create_quote.dart'
|
||||
as _i4;
|
||||
import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i5;
|
||||
import 'package:wien_talks_server/src/generated/votes/vote_request.dart' as _i6;
|
||||
import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i7;
|
||||
|
||||
class Endpoints extends _i1.EndpointDispatch {
|
||||
@override
|
||||
void initializeEndpoints(_i1.Server server) {
|
||||
var endpoints = <String, _i1.Endpoint>{
|
||||
'health': _i2.HealthEndpoint()
|
||||
..initialize(
|
||||
server,
|
||||
'health',
|
||||
null,
|
||||
),
|
||||
'quote': _i3.QuoteEndpoint()
|
||||
'quote': _i2.QuoteEndpoint()
|
||||
..initialize(
|
||||
server,
|
||||
'quote',
|
||||
null,
|
||||
),
|
||||
'votes': _i4.VotesEndpoint()
|
||||
'votes': _i3.VotesEndpoint()
|
||||
..initialize(
|
||||
server,
|
||||
'votes',
|
||||
null,
|
||||
),
|
||||
};
|
||||
connectors['health'] = _i1.EndpointConnector(
|
||||
name: 'health',
|
||||
endpoint: endpoints['health']!,
|
||||
methodConnectors: {
|
||||
'ping': _i1.MethodConnector(
|
||||
name: 'ping',
|
||||
params: {
|
||||
'note': _i1.ParameterDescription(
|
||||
name: 'note',
|
||||
type: _i1.getType<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(
|
||||
name: 'quote',
|
||||
endpoint: endpoints['quote']!,
|
||||
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(
|
||||
name: 'createQuote',
|
||||
params: {
|
||||
'req': _i1.ParameterDescription(
|
||||
name: 'req',
|
||||
type: _i1.getType<_i5.CreateQuoteRequest>(),
|
||||
type: _i1.getType<_i4.CreateQuoteRequest>(),
|
||||
nullable: false,
|
||||
)
|
||||
},
|
||||
|
|
@ -99,7 +52,7 @@ class Endpoints extends _i1.EndpointDispatch {
|
|||
_i1.Session session,
|
||||
Map<String, dynamic> params,
|
||||
) async =>
|
||||
(endpoints['quote'] as _i3.QuoteEndpoint).createQuote(
|
||||
(endpoints['quote'] as _i2.QuoteEndpoint).createQuote(
|
||||
session,
|
||||
params['req'],
|
||||
),
|
||||
|
|
@ -109,7 +62,7 @@ class Endpoints extends _i1.EndpointDispatch {
|
|||
params: {
|
||||
'quote': _i1.ParameterDescription(
|
||||
name: 'quote',
|
||||
type: _i1.getType<_i6.Quote>(),
|
||||
type: _i1.getType<_i5.Quote>(),
|
||||
nullable: false,
|
||||
)
|
||||
},
|
||||
|
|
@ -117,7 +70,7 @@ class Endpoints extends _i1.EndpointDispatch {
|
|||
_i1.Session session,
|
||||
Map<String, dynamic> params,
|
||||
) async =>
|
||||
(endpoints['quote'] as _i3.QuoteEndpoint).updateQuote(
|
||||
(endpoints['quote'] as _i2.QuoteEndpoint).updateQuote(
|
||||
session,
|
||||
params['quote'],
|
||||
),
|
||||
|
|
@ -129,7 +82,7 @@ class Endpoints extends _i1.EndpointDispatch {
|
|||
_i1.Session session,
|
||||
Map<String, dynamic> params,
|
||||
) async =>
|
||||
(endpoints['quote'] as _i3.QuoteEndpoint).getAllQuotes(session),
|
||||
(endpoints['quote'] as _i2.QuoteEndpoint).getAllQuotes(session),
|
||||
),
|
||||
},
|
||||
);
|
||||
|
|
@ -137,6 +90,24 @@ class Endpoints extends _i1.EndpointDispatch {
|
|||
name: 'votes',
|
||||
endpoint: endpoints['votes']!,
|
||||
methodConnectors: {
|
||||
'postVote': _i1.MethodConnector(
|
||||
name: 'postVote',
|
||||
params: {
|
||||
'voteRequest': _i1.ParameterDescription(
|
||||
name: 'voteRequest',
|
||||
type: _i1.getType<_i6.VoteRequest>(),
|
||||
nullable: false,
|
||||
)
|
||||
},
|
||||
call: (
|
||||
_i1.Session session,
|
||||
Map<String, dynamic> params,
|
||||
) async =>
|
||||
(endpoints['votes'] as _i3.VotesEndpoint).postVote(
|
||||
session,
|
||||
params['voteRequest'],
|
||||
),
|
||||
),
|
||||
'getAllVotes': _i1.MethodConnector(
|
||||
name: 'getAllVotes',
|
||||
params: {},
|
||||
|
|
@ -144,25 +115,7 @@ class Endpoints extends _i1.EndpointDispatch {
|
|||
_i1.Session session,
|
||||
Map<String, dynamic> params,
|
||||
) async =>
|
||||
(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),
|
||||
(endpoints['votes'] as _i3.VotesEndpoint).getAllVotes(session),
|
||||
),
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -12,17 +12,16 @@
|
|||
import 'package:serverpod/serverpod.dart' as _i1;
|
||||
import 'package:serverpod/protocol.dart' as _i2;
|
||||
import 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i3;
|
||||
import 'create_quote.dart' as _i4;
|
||||
import 'health.dart' as _i5;
|
||||
import 'quote.dart' as _i6;
|
||||
import 'vote.dart' as _i7;
|
||||
import 'package:wien_talks_server/src/generated/health.dart' as _i8;
|
||||
import 'package:wien_talks_server/src/generated/quote.dart' as _i9;
|
||||
import 'package:wien_talks_server/src/generated/vote.dart' as _i10;
|
||||
export 'create_quote.dart';
|
||||
export 'health.dart';
|
||||
export 'quote.dart';
|
||||
export 'vote.dart';
|
||||
import 'quotes/create_quote.dart' as _i4;
|
||||
import 'quotes/quote.dart' as _i5;
|
||||
import 'votes/vote.dart' as _i6;
|
||||
import 'votes/vote_request.dart' as _i7;
|
||||
import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i8;
|
||||
import 'package:wien_talks_server/src/generated/votes/vote.dart' as _i9;
|
||||
export 'quotes/create_quote.dart';
|
||||
export 'quotes/quote.dart';
|
||||
export 'votes/vote.dart';
|
||||
export 'votes/vote_request.dart';
|
||||
|
||||
class Protocol extends _i1.SerializationManagerServer {
|
||||
Protocol._();
|
||||
|
|
@ -32,50 +31,6 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
static final Protocol _instance = Protocol._();
|
||||
|
||||
static final List<_i2.TableDefinition> targetTableDefinitions = [
|
||||
_i2.TableDefinition(
|
||||
name: 'health',
|
||||
dartName: 'Health',
|
||||
schema: 'public',
|
||||
module: 'wien_talks',
|
||||
columns: [
|
||||
_i2.ColumnDefinition(
|
||||
name: 'id',
|
||||
columnType: _i2.ColumnType.bigint,
|
||||
isNullable: false,
|
||||
dartType: 'int?',
|
||||
columnDefault: 'nextval(\'health_id_seq\'::regclass)',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'createdAt',
|
||||
columnType: _i2.ColumnType.timestampWithoutTimeZone,
|
||||
isNullable: false,
|
||||
dartType: 'DateTime',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'note',
|
||||
columnType: _i2.ColumnType.text,
|
||||
isNullable: true,
|
||||
dartType: 'String?',
|
||||
),
|
||||
],
|
||||
foreignKeys: [],
|
||||
indexes: [
|
||||
_i2.IndexDefinition(
|
||||
indexName: 'health_pkey',
|
||||
tableSpace: null,
|
||||
elements: [
|
||||
_i2.IndexElementDefinition(
|
||||
type: _i2.IndexElementDefinitionType.column,
|
||||
definition: 'id',
|
||||
)
|
||||
],
|
||||
type: 'btree',
|
||||
isUnique: true,
|
||||
isPrimary: true,
|
||||
)
|
||||
],
|
||||
managed: true,
|
||||
),
|
||||
_i2.TableDefinition(
|
||||
name: 'quote',
|
||||
dartName: 'Quote',
|
||||
|
|
@ -194,10 +149,10 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
dartType: 'DateTime',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'quoteId',
|
||||
columnType: _i2.ColumnType.bigint,
|
||||
name: 'quote',
|
||||
columnType: _i2.ColumnType.json,
|
||||
isNullable: false,
|
||||
dartType: 'int',
|
||||
dartType: 'protocol:Quote',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'upvote',
|
||||
|
|
@ -224,6 +179,56 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
],
|
||||
managed: true,
|
||||
),
|
||||
_i2.TableDefinition(
|
||||
name: 'vote_request',
|
||||
dartName: 'VoteRequest',
|
||||
schema: 'public',
|
||||
module: 'wien_talks',
|
||||
columns: [
|
||||
_i2.ColumnDefinition(
|
||||
name: 'id',
|
||||
columnType: _i2.ColumnType.bigint,
|
||||
isNullable: false,
|
||||
dartType: 'int?',
|
||||
columnDefault: 'nextval(\'vote_request_id_seq\'::regclass)',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'userId',
|
||||
columnType: _i2.ColumnType.bigint,
|
||||
isNullable: false,
|
||||
dartType: 'int',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'quote',
|
||||
columnType: _i2.ColumnType.json,
|
||||
isNullable: false,
|
||||
dartType: 'protocol:Quote',
|
||||
),
|
||||
_i2.ColumnDefinition(
|
||||
name: 'upvote',
|
||||
columnType: _i2.ColumnType.boolean,
|
||||
isNullable: false,
|
||||
dartType: 'bool',
|
||||
),
|
||||
],
|
||||
foreignKeys: [],
|
||||
indexes: [
|
||||
_i2.IndexDefinition(
|
||||
indexName: 'vote_request_pkey',
|
||||
tableSpace: null,
|
||||
elements: [
|
||||
_i2.IndexElementDefinition(
|
||||
type: _i2.IndexElementDefinitionType.column,
|
||||
definition: 'id',
|
||||
)
|
||||
],
|
||||
type: 'btree',
|
||||
isUnique: true,
|
||||
isPrimary: true,
|
||||
)
|
||||
],
|
||||
managed: true,
|
||||
),
|
||||
..._i3.Protocol.targetTableDefinitions,
|
||||
..._i2.Protocol.targetTableDefinitions,
|
||||
];
|
||||
|
|
@ -237,26 +242,26 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
if (t == _i4.CreateQuoteRequest) {
|
||||
return _i4.CreateQuoteRequest.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i5.Health) {
|
||||
return _i5.Health.fromJson(data) as T;
|
||||
if (t == _i5.Quote) {
|
||||
return _i5.Quote.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i6.Quote) {
|
||||
return _i6.Quote.fromJson(data) as T;
|
||||
if (t == _i6.Vote) {
|
||||
return _i6.Vote.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i7.Vote) {
|
||||
return _i7.Vote.fromJson(data) as T;
|
||||
if (t == _i7.VoteRequest) {
|
||||
return _i7.VoteRequest.fromJson(data) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i4.CreateQuoteRequest?>()) {
|
||||
return (data != null ? _i4.CreateQuoteRequest.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i5.Health?>()) {
|
||||
return (data != null ? _i5.Health.fromJson(data) : null) as T;
|
||||
if (t == _i1.getType<_i5.Quote?>()) {
|
||||
return (data != null ? _i5.Quote.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i6.Quote?>()) {
|
||||
return (data != null ? _i6.Quote.fromJson(data) : null) as T;
|
||||
if (t == _i1.getType<_i6.Vote?>()) {
|
||||
return (data != null ? _i6.Vote.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<_i7.Vote?>()) {
|
||||
return (data != null ? _i7.Vote.fromJson(data) : null) as T;
|
||||
if (t == _i1.getType<_i7.VoteRequest?>()) {
|
||||
return (data != null ? _i7.VoteRequest.fromJson(data) : null) as T;
|
||||
}
|
||||
if (t == _i1.getType<List<String>?>()) {
|
||||
return (data != null
|
||||
|
|
@ -268,15 +273,11 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
? (data as List).map((e) => deserialize<String>(e)).toList()
|
||||
: null) as T;
|
||||
}
|
||||
if (t == List<_i8.Health>) {
|
||||
return (data as List).map((e) => deserialize<_i8.Health>(e)).toList()
|
||||
as T;
|
||||
if (t == List<_i8.Quote>) {
|
||||
return (data as List).map((e) => deserialize<_i8.Quote>(e)).toList() as T;
|
||||
}
|
||||
if (t == List<_i9.Quote>) {
|
||||
return (data as List).map((e) => deserialize<_i9.Quote>(e)).toList() as T;
|
||||
}
|
||||
if (t == List<_i10.Vote>) {
|
||||
return (data as List).map((e) => deserialize<_i10.Vote>(e)).toList() as T;
|
||||
if (t == List<_i9.Vote>) {
|
||||
return (data as List).map((e) => deserialize<_i9.Vote>(e)).toList() as T;
|
||||
}
|
||||
try {
|
||||
return _i3.Protocol().deserialize<T>(data, t);
|
||||
|
|
@ -294,15 +295,15 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
if (data is _i4.CreateQuoteRequest) {
|
||||
return 'CreateQuoteRequest';
|
||||
}
|
||||
if (data is _i5.Health) {
|
||||
return 'Health';
|
||||
}
|
||||
if (data is _i6.Quote) {
|
||||
if (data is _i5.Quote) {
|
||||
return 'Quote';
|
||||
}
|
||||
if (data is _i7.Vote) {
|
||||
if (data is _i6.Vote) {
|
||||
return 'Vote';
|
||||
}
|
||||
if (data is _i7.VoteRequest) {
|
||||
return 'VoteRequest';
|
||||
}
|
||||
className = _i2.Protocol().getClassNameForObject(data);
|
||||
if (className != null) {
|
||||
return 'serverpod.$className';
|
||||
|
|
@ -323,14 +324,14 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
if (dataClassName == 'CreateQuoteRequest') {
|
||||
return deserialize<_i4.CreateQuoteRequest>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'Health') {
|
||||
return deserialize<_i5.Health>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'Quote') {
|
||||
return deserialize<_i6.Quote>(data['data']);
|
||||
return deserialize<_i5.Quote>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'Vote') {
|
||||
return deserialize<_i7.Vote>(data['data']);
|
||||
return deserialize<_i6.Vote>(data['data']);
|
||||
}
|
||||
if (dataClassName == 'VoteRequest') {
|
||||
return deserialize<_i7.VoteRequest>(data['data']);
|
||||
}
|
||||
if (dataClassName.startsWith('serverpod.')) {
|
||||
data['className'] = dataClassName.substring(10);
|
||||
|
|
@ -358,12 +359,12 @@ class Protocol extends _i1.SerializationManagerServer {
|
|||
}
|
||||
}
|
||||
switch (t) {
|
||||
case _i5.Health:
|
||||
return _i5.Health.t;
|
||||
case _i6.Quote:
|
||||
return _i6.Quote.t;
|
||||
case _i7.Vote:
|
||||
return _i7.Vote.t;
|
||||
case _i5.Quote:
|
||||
return _i5.Quote.t;
|
||||
case _i6.Vote:
|
||||
return _i6.Vote.t;
|
||||
case _i7.VoteRequest:
|
||||
return _i7.VoteRequest.t;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
health:
|
||||
- ping:
|
||||
- all:
|
||||
quote:
|
||||
- dbPing:
|
||||
- createQuote:
|
||||
- updateQuote:
|
||||
- getAllQuotes:
|
||||
votes:
|
||||
- postVote:
|
||||
- getAllVotes:
|
||||
- createVote:
|
||||
- sayHello:
|
||||
|
|
|
|||
|
|
@ -10,13 +10,14 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:serverpod/serverpod.dart' as _i1;
|
||||
import '../quotes/quote.dart' as _i2;
|
||||
|
||||
abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
||||
Vote._({
|
||||
this.id,
|
||||
required this.userId,
|
||||
required this.createdAt,
|
||||
required this.quoteId,
|
||||
required this.quote,
|
||||
required this.upvote,
|
||||
});
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
int? id,
|
||||
required int userId,
|
||||
required DateTime createdAt,
|
||||
required int quoteId,
|
||||
required _i2.Quote quote,
|
||||
required bool upvote,
|
||||
}) = _VoteImpl;
|
||||
|
||||
|
|
@ -34,7 +35,8 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
userId: jsonSerialization['userId'] as int,
|
||||
createdAt:
|
||||
_i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']),
|
||||
quoteId: jsonSerialization['quoteId'] as int,
|
||||
quote: _i2.Quote.fromJson(
|
||||
(jsonSerialization['quote'] as Map<String, dynamic>)),
|
||||
upvote: jsonSerialization['upvote'] as bool,
|
||||
);
|
||||
}
|
||||
|
|
@ -50,7 +52,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
|
||||
DateTime createdAt;
|
||||
|
||||
int quoteId;
|
||||
_i2.Quote quote;
|
||||
|
||||
bool upvote;
|
||||
|
||||
|
|
@ -64,7 +66,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
int? id,
|
||||
int? userId,
|
||||
DateTime? createdAt,
|
||||
int? quoteId,
|
||||
_i2.Quote? quote,
|
||||
bool? upvote,
|
||||
});
|
||||
@override
|
||||
|
|
@ -73,7 +75,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
if (id != null) 'id': id,
|
||||
'userId': userId,
|
||||
'createdAt': createdAt.toJson(),
|
||||
'quoteId': quoteId,
|
||||
'quote': quote.toJson(),
|
||||
'upvote': upvote,
|
||||
};
|
||||
}
|
||||
|
|
@ -84,7 +86,7 @@ abstract class Vote implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
if (id != null) 'id': id,
|
||||
'userId': userId,
|
||||
'createdAt': createdAt.toJson(),
|
||||
'quoteId': quoteId,
|
||||
'quote': quote.toJsonForProtocol(),
|
||||
'upvote': upvote,
|
||||
};
|
||||
}
|
||||
|
|
@ -126,13 +128,13 @@ class _VoteImpl extends Vote {
|
|||
int? id,
|
||||
required int userId,
|
||||
required DateTime createdAt,
|
||||
required int quoteId,
|
||||
required _i2.Quote quote,
|
||||
required bool upvote,
|
||||
}) : super._(
|
||||
id: id,
|
||||
userId: userId,
|
||||
createdAt: createdAt,
|
||||
quoteId: quoteId,
|
||||
quote: quote,
|
||||
upvote: upvote,
|
||||
);
|
||||
|
||||
|
|
@ -144,14 +146,14 @@ class _VoteImpl extends Vote {
|
|||
Object? id = _Undefined,
|
||||
int? userId,
|
||||
DateTime? createdAt,
|
||||
int? quoteId,
|
||||
_i2.Quote? quote,
|
||||
bool? upvote,
|
||||
}) {
|
||||
return Vote(
|
||||
id: id is int? ? id : this.id,
|
||||
userId: userId ?? this.userId,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
quoteId: quoteId ?? this.quoteId,
|
||||
quote: quote ?? this.quote.copyWith(),
|
||||
upvote: upvote ?? this.upvote,
|
||||
);
|
||||
}
|
||||
|
|
@ -167,8 +169,8 @@ class VoteTable extends _i1.Table<int?> {
|
|||
'createdAt',
|
||||
this,
|
||||
);
|
||||
quoteId = _i1.ColumnInt(
|
||||
'quoteId',
|
||||
quote = _i1.ColumnSerializable(
|
||||
'quote',
|
||||
this,
|
||||
);
|
||||
upvote = _i1.ColumnBool(
|
||||
|
|
@ -181,7 +183,7 @@ class VoteTable extends _i1.Table<int?> {
|
|||
|
||||
late final _i1.ColumnDateTime createdAt;
|
||||
|
||||
late final _i1.ColumnInt quoteId;
|
||||
late final _i1.ColumnSerializable quote;
|
||||
|
||||
late final _i1.ColumnBool upvote;
|
||||
|
||||
|
|
@ -190,7 +192,7 @@ class VoteTable extends _i1.Table<int?> {
|
|||
id,
|
||||
userId,
|
||||
createdAt,
|
||||
quoteId,
|
||||
quote,
|
||||
upvote,
|
||||
];
|
||||
}
|
||||
|
|
@ -10,57 +10,66 @@
|
|||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:serverpod/serverpod.dart' as _i1;
|
||||
import '../quotes/quote.dart' as _i2;
|
||||
|
||||
abstract class Health implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
||||
Health._({
|
||||
abstract class VoteRequest
|
||||
implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
||||
VoteRequest._({
|
||||
this.id,
|
||||
required this.createdAt,
|
||||
this.note,
|
||||
required this.userId,
|
||||
required this.quote,
|
||||
required this.upvote,
|
||||
});
|
||||
|
||||
factory Health({
|
||||
factory VoteRequest({
|
||||
int? id,
|
||||
required DateTime createdAt,
|
||||
String? note,
|
||||
}) = _HealthImpl;
|
||||
required int userId,
|
||||
required _i2.Quote quote,
|
||||
required bool upvote,
|
||||
}) = _VoteRequestImpl;
|
||||
|
||||
factory Health.fromJson(Map<String, dynamic> jsonSerialization) {
|
||||
return Health(
|
||||
factory VoteRequest.fromJson(Map<String, dynamic> jsonSerialization) {
|
||||
return VoteRequest(
|
||||
id: jsonSerialization['id'] as int?,
|
||||
createdAt:
|
||||
_i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']),
|
||||
note: jsonSerialization['note'] as String?,
|
||||
userId: jsonSerialization['userId'] as int,
|
||||
quote: _i2.Quote.fromJson(
|
||||
(jsonSerialization['quote'] as Map<String, dynamic>)),
|
||||
upvote: jsonSerialization['upvote'] as bool,
|
||||
);
|
||||
}
|
||||
|
||||
static final t = HealthTable();
|
||||
static final t = VoteRequestTable();
|
||||
|
||||
static const db = HealthRepository._();
|
||||
static const db = VoteRequestRepository._();
|
||||
|
||||
@override
|
||||
int? id;
|
||||
|
||||
DateTime createdAt;
|
||||
int userId;
|
||||
|
||||
String? note;
|
||||
_i2.Quote quote;
|
||||
|
||||
bool upvote;
|
||||
|
||||
@override
|
||||
_i1.Table<int?> get table => t;
|
||||
|
||||
/// Returns a shallow copy of this [Health]
|
||||
/// Returns a shallow copy of this [VoteRequest]
|
||||
/// with some or all fields replaced by the given arguments.
|
||||
@_i1.useResult
|
||||
Health copyWith({
|
||||
VoteRequest copyWith({
|
||||
int? id,
|
||||
DateTime? createdAt,
|
||||
String? note,
|
||||
int? userId,
|
||||
_i2.Quote? quote,
|
||||
bool? upvote,
|
||||
});
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
if (id != null) 'id': id,
|
||||
'createdAt': createdAt.toJson(),
|
||||
if (note != null) 'note': note,
|
||||
'userId': userId,
|
||||
'quote': quote.toJson(),
|
||||
'upvote': upvote,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -68,31 +77,32 @@ abstract class Health implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
Map<String, dynamic> toJsonForProtocol() {
|
||||
return {
|
||||
if (id != null) 'id': id,
|
||||
'createdAt': createdAt.toJson(),
|
||||
if (note != null) 'note': note,
|
||||
'userId': userId,
|
||||
'quote': quote.toJsonForProtocol(),
|
||||
'upvote': upvote,
|
||||
};
|
||||
}
|
||||
|
||||
static HealthInclude include() {
|
||||
return HealthInclude._();
|
||||
static VoteRequestInclude include() {
|
||||
return VoteRequestInclude._();
|
||||
}
|
||||
|
||||
static HealthIncludeList includeList({
|
||||
_i1.WhereExpressionBuilder<HealthTable>? where,
|
||||
static VoteRequestIncludeList includeList({
|
||||
_i1.WhereExpressionBuilder<VoteRequestTable>? where,
|
||||
int? limit,
|
||||
int? offset,
|
||||
_i1.OrderByBuilder<HealthTable>? orderBy,
|
||||
_i1.OrderByBuilder<VoteRequestTable>? orderBy,
|
||||
bool orderDescending = false,
|
||||
_i1.OrderByListBuilder<HealthTable>? orderByList,
|
||||
HealthInclude? include,
|
||||
_i1.OrderByListBuilder<VoteRequestTable>? orderByList,
|
||||
VoteRequestInclude? include,
|
||||
}) {
|
||||
return HealthIncludeList._(
|
||||
return VoteRequestIncludeList._(
|
||||
where: where,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
orderBy: orderBy?.call(Health.t),
|
||||
orderBy: orderBy?.call(VoteRequest.t),
|
||||
orderDescending: orderDescending,
|
||||
orderByList: orderByList?.call(Health.t),
|
||||
orderByList: orderByList?.call(VoteRequest.t),
|
||||
include: include,
|
||||
);
|
||||
}
|
||||
|
|
@ -105,71 +115,82 @@ abstract class Health implements _i1.TableRow<int?>, _i1.ProtocolSerialization {
|
|||
|
||||
class _Undefined {}
|
||||
|
||||
class _HealthImpl extends Health {
|
||||
_HealthImpl({
|
||||
class _VoteRequestImpl extends VoteRequest {
|
||||
_VoteRequestImpl({
|
||||
int? id,
|
||||
required DateTime createdAt,
|
||||
String? note,
|
||||
required int userId,
|
||||
required _i2.Quote quote,
|
||||
required bool upvote,
|
||||
}) : super._(
|
||||
id: id,
|
||||
createdAt: createdAt,
|
||||
note: note,
|
||||
userId: userId,
|
||||
quote: quote,
|
||||
upvote: upvote,
|
||||
);
|
||||
|
||||
/// Returns a shallow copy of this [Health]
|
||||
/// Returns a shallow copy of this [VoteRequest]
|
||||
/// with some or all fields replaced by the given arguments.
|
||||
@_i1.useResult
|
||||
@override
|
||||
Health copyWith({
|
||||
VoteRequest copyWith({
|
||||
Object? id = _Undefined,
|
||||
DateTime? createdAt,
|
||||
Object? note = _Undefined,
|
||||
int? userId,
|
||||
_i2.Quote? quote,
|
||||
bool? upvote,
|
||||
}) {
|
||||
return Health(
|
||||
return VoteRequest(
|
||||
id: id is int? ? id : this.id,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
note: note is String? ? note : this.note,
|
||||
userId: userId ?? this.userId,
|
||||
quote: quote ?? this.quote.copyWith(),
|
||||
upvote: upvote ?? this.upvote,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HealthTable extends _i1.Table<int?> {
|
||||
HealthTable({super.tableRelation}) : super(tableName: 'health') {
|
||||
createdAt = _i1.ColumnDateTime(
|
||||
'createdAt',
|
||||
class VoteRequestTable extends _i1.Table<int?> {
|
||||
VoteRequestTable({super.tableRelation}) : super(tableName: 'vote_request') {
|
||||
userId = _i1.ColumnInt(
|
||||
'userId',
|
||||
this,
|
||||
);
|
||||
note = _i1.ColumnString(
|
||||
'note',
|
||||
quote = _i1.ColumnSerializable(
|
||||
'quote',
|
||||
this,
|
||||
);
|
||||
upvote = _i1.ColumnBool(
|
||||
'upvote',
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
late final _i1.ColumnDateTime createdAt;
|
||||
late final _i1.ColumnInt userId;
|
||||
|
||||
late final _i1.ColumnString note;
|
||||
late final _i1.ColumnSerializable quote;
|
||||
|
||||
late final _i1.ColumnBool upvote;
|
||||
|
||||
@override
|
||||
List<_i1.Column> get columns => [
|
||||
id,
|
||||
createdAt,
|
||||
note,
|
||||
userId,
|
||||
quote,
|
||||
upvote,
|
||||
];
|
||||
}
|
||||
|
||||
class HealthInclude extends _i1.IncludeObject {
|
||||
HealthInclude._();
|
||||
class VoteRequestInclude extends _i1.IncludeObject {
|
||||
VoteRequestInclude._();
|
||||
|
||||
@override
|
||||
Map<String, _i1.Include?> get includes => {};
|
||||
|
||||
@override
|
||||
_i1.Table<int?> get table => Health.t;
|
||||
_i1.Table<int?> get table => VoteRequest.t;
|
||||
}
|
||||
|
||||
class HealthIncludeList extends _i1.IncludeList {
|
||||
HealthIncludeList._({
|
||||
_i1.WhereExpressionBuilder<HealthTable>? where,
|
||||
class VoteRequestIncludeList extends _i1.IncludeList {
|
||||
VoteRequestIncludeList._({
|
||||
_i1.WhereExpressionBuilder<VoteRequestTable>? where,
|
||||
super.limit,
|
||||
super.offset,
|
||||
super.orderBy,
|
||||
|
|
@ -177,20 +198,20 @@ class HealthIncludeList extends _i1.IncludeList {
|
|||
super.orderByList,
|
||||
super.include,
|
||||
}) {
|
||||
super.where = where?.call(Health.t);
|
||||
super.where = where?.call(VoteRequest.t);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, _i1.Include?> get includes => include?.includes ?? {};
|
||||
|
||||
@override
|
||||
_i1.Table<int?> get table => Health.t;
|
||||
_i1.Table<int?> get table => VoteRequest.t;
|
||||
}
|
||||
|
||||
class HealthRepository {
|
||||
const HealthRepository._();
|
||||
class VoteRequestRepository {
|
||||
const VoteRequestRepository._();
|
||||
|
||||
/// Returns a list of [Health]s matching the given query parameters.
|
||||
/// Returns a list of [VoteRequest]s matching the given query parameters.
|
||||
///
|
||||
/// Use [where] to specify which items to include in the return value.
|
||||
/// If none is specified, all items will be returned.
|
||||
|
|
@ -212,20 +233,20 @@ class HealthRepository {
|
|||
/// limit: 100,
|
||||
/// );
|
||||
/// ```
|
||||
Future<List<Health>> find(
|
||||
Future<List<VoteRequest>> find(
|
||||
_i1.Session session, {
|
||||
_i1.WhereExpressionBuilder<HealthTable>? where,
|
||||
_i1.WhereExpressionBuilder<VoteRequestTable>? where,
|
||||
int? limit,
|
||||
int? offset,
|
||||
_i1.OrderByBuilder<HealthTable>? orderBy,
|
||||
_i1.OrderByBuilder<VoteRequestTable>? orderBy,
|
||||
bool orderDescending = false,
|
||||
_i1.OrderByListBuilder<HealthTable>? orderByList,
|
||||
_i1.OrderByListBuilder<VoteRequestTable>? orderByList,
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.find<Health>(
|
||||
where: where?.call(Health.t),
|
||||
orderBy: orderBy?.call(Health.t),
|
||||
orderByList: orderByList?.call(Health.t),
|
||||
return session.db.find<VoteRequest>(
|
||||
where: where?.call(VoteRequest.t),
|
||||
orderBy: orderBy?.call(VoteRequest.t),
|
||||
orderByList: orderByList?.call(VoteRequest.t),
|
||||
orderDescending: orderDescending,
|
||||
limit: limit,
|
||||
offset: offset,
|
||||
|
|
@ -233,7 +254,7 @@ class HealthRepository {
|
|||
);
|
||||
}
|
||||
|
||||
/// Returns the first matching [Health] matching the given query parameters.
|
||||
/// Returns the first matching [VoteRequest] matching the given query parameters.
|
||||
///
|
||||
/// Use [where] to specify which items to include in the return value.
|
||||
/// If none is specified, all items will be returned.
|
||||
|
|
@ -250,136 +271,136 @@ class HealthRepository {
|
|||
/// orderBy: (t) => t.age,
|
||||
/// );
|
||||
/// ```
|
||||
Future<Health?> findFirstRow(
|
||||
Future<VoteRequest?> findFirstRow(
|
||||
_i1.Session session, {
|
||||
_i1.WhereExpressionBuilder<HealthTable>? where,
|
||||
_i1.WhereExpressionBuilder<VoteRequestTable>? where,
|
||||
int? offset,
|
||||
_i1.OrderByBuilder<HealthTable>? orderBy,
|
||||
_i1.OrderByBuilder<VoteRequestTable>? orderBy,
|
||||
bool orderDescending = false,
|
||||
_i1.OrderByListBuilder<HealthTable>? orderByList,
|
||||
_i1.OrderByListBuilder<VoteRequestTable>? orderByList,
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.findFirstRow<Health>(
|
||||
where: where?.call(Health.t),
|
||||
orderBy: orderBy?.call(Health.t),
|
||||
orderByList: orderByList?.call(Health.t),
|
||||
return session.db.findFirstRow<VoteRequest>(
|
||||
where: where?.call(VoteRequest.t),
|
||||
orderBy: orderBy?.call(VoteRequest.t),
|
||||
orderByList: orderByList?.call(VoteRequest.t),
|
||||
orderDescending: orderDescending,
|
||||
offset: offset,
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Finds a single [Health] by its [id] or null if no such row exists.
|
||||
Future<Health?> findById(
|
||||
/// Finds a single [VoteRequest] by its [id] or null if no such row exists.
|
||||
Future<VoteRequest?> findById(
|
||||
_i1.Session session,
|
||||
int id, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.findById<Health>(
|
||||
return session.db.findById<VoteRequest>(
|
||||
id,
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Inserts all [Health]s in the list and returns the inserted rows.
|
||||
/// Inserts all [VoteRequest]s in the list and returns the inserted rows.
|
||||
///
|
||||
/// The returned [Health]s will have their `id` fields set.
|
||||
/// The returned [VoteRequest]s will have their `id` fields set.
|
||||
///
|
||||
/// This is an atomic operation, meaning that if one of the rows fails to
|
||||
/// insert, none of the rows will be inserted.
|
||||
Future<List<Health>> insert(
|
||||
Future<List<VoteRequest>> insert(
|
||||
_i1.Session session,
|
||||
List<Health> rows, {
|
||||
List<VoteRequest> rows, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.insert<Health>(
|
||||
return session.db.insert<VoteRequest>(
|
||||
rows,
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Inserts a single [Health] and returns the inserted row.
|
||||
/// Inserts a single [VoteRequest] and returns the inserted row.
|
||||
///
|
||||
/// The returned [Health] will have its `id` field set.
|
||||
Future<Health> insertRow(
|
||||
/// The returned [VoteRequest] will have its `id` field set.
|
||||
Future<VoteRequest> insertRow(
|
||||
_i1.Session session,
|
||||
Health row, {
|
||||
VoteRequest row, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.insertRow<Health>(
|
||||
return session.db.insertRow<VoteRequest>(
|
||||
row,
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Updates all [Health]s in the list and returns the updated rows. If
|
||||
/// Updates all [VoteRequest]s in the list and returns the updated rows. If
|
||||
/// [columns] is provided, only those columns will be updated. Defaults to
|
||||
/// all columns.
|
||||
/// This is an atomic operation, meaning that if one of the rows fails to
|
||||
/// update, none of the rows will be updated.
|
||||
Future<List<Health>> update(
|
||||
Future<List<VoteRequest>> update(
|
||||
_i1.Session session,
|
||||
List<Health> rows, {
|
||||
_i1.ColumnSelections<HealthTable>? columns,
|
||||
List<VoteRequest> rows, {
|
||||
_i1.ColumnSelections<VoteRequestTable>? columns,
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.update<Health>(
|
||||
return session.db.update<VoteRequest>(
|
||||
rows,
|
||||
columns: columns?.call(Health.t),
|
||||
columns: columns?.call(VoteRequest.t),
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Updates a single [Health]. The row needs to have its id set.
|
||||
/// Updates a single [VoteRequest]. The row needs to have its id set.
|
||||
/// Optionally, a list of [columns] can be provided to only update those
|
||||
/// columns. Defaults to all columns.
|
||||
Future<Health> updateRow(
|
||||
Future<VoteRequest> updateRow(
|
||||
_i1.Session session,
|
||||
Health row, {
|
||||
_i1.ColumnSelections<HealthTable>? columns,
|
||||
VoteRequest row, {
|
||||
_i1.ColumnSelections<VoteRequestTable>? columns,
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.updateRow<Health>(
|
||||
return session.db.updateRow<VoteRequest>(
|
||||
row,
|
||||
columns: columns?.call(Health.t),
|
||||
columns: columns?.call(VoteRequest.t),
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Deletes all [Health]s in the list and returns the deleted rows.
|
||||
/// Deletes all [VoteRequest]s in the list and returns the deleted rows.
|
||||
/// This is an atomic operation, meaning that if one of the rows fail to
|
||||
/// be deleted, none of the rows will be deleted.
|
||||
Future<List<Health>> delete(
|
||||
Future<List<VoteRequest>> delete(
|
||||
_i1.Session session,
|
||||
List<Health> rows, {
|
||||
List<VoteRequest> rows, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.delete<Health>(
|
||||
return session.db.delete<VoteRequest>(
|
||||
rows,
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Deletes a single [Health].
|
||||
Future<Health> deleteRow(
|
||||
/// Deletes a single [VoteRequest].
|
||||
Future<VoteRequest> deleteRow(
|
||||
_i1.Session session,
|
||||
Health row, {
|
||||
VoteRequest row, {
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.deleteRow<Health>(
|
||||
return session.db.deleteRow<VoteRequest>(
|
||||
row,
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
||||
/// Deletes all rows matching the [where] expression.
|
||||
Future<List<Health>> deleteWhere(
|
||||
Future<List<VoteRequest>> deleteWhere(
|
||||
_i1.Session session, {
|
||||
required _i1.WhereExpressionBuilder<HealthTable> where,
|
||||
required _i1.WhereExpressionBuilder<VoteRequestTable> where,
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.deleteWhere<Health>(
|
||||
where: where(Health.t),
|
||||
return session.db.deleteWhere<VoteRequest>(
|
||||
where: where(VoteRequest.t),
|
||||
transaction: transaction,
|
||||
);
|
||||
}
|
||||
|
|
@ -388,12 +409,12 @@ class HealthRepository {
|
|||
/// will return the count of all rows in the table.
|
||||
Future<int> count(
|
||||
_i1.Session session, {
|
||||
_i1.WhereExpressionBuilder<HealthTable>? where,
|
||||
_i1.WhereExpressionBuilder<VoteRequestTable>? where,
|
||||
int? limit,
|
||||
_i1.Transaction? transaction,
|
||||
}) async {
|
||||
return session.db.count<Health>(
|
||||
where: where?.call(Health.t),
|
||||
return session.db.count<VoteRequest>(
|
||||
where: where?.call(VoteRequest.t),
|
||||
limit: limit,
|
||||
transaction: transaction,
|
||||
);
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
class: Health
|
||||
table: health
|
||||
fields:
|
||||
createdAt: DateTime
|
||||
note: String?
|
||||
|
|
@ -8,13 +8,6 @@ import 'package:wien_talks_server/src/quotes/quote_util.dart';
|
|||
class QuoteEndpoint extends Endpoint {
|
||||
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 {
|
||||
final authInfo = await session.authenticated;
|
||||
final userId = authInfo?.userId;
|
||||
|
|
@ -51,8 +44,8 @@ class QuoteEndpoint extends Endpoint {
|
|||
final quoteList = await Quote.db.find(
|
||||
session,
|
||||
// where: (t) => t.visibility.equals(0),
|
||||
orderBy: (t) => t.createdAt,
|
||||
orderDescending: true,
|
||||
// orderBy: (t) => t.createdAt,
|
||||
// orderDescending: true,
|
||||
);
|
||||
|
||||
for (var element in quoteList) {
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ table: vote
|
|||
fields:
|
||||
userId: int
|
||||
createdAt: DateTime
|
||||
quoteId: int
|
||||
quote: Quote
|
||||
upvote: bool
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
class: VoteRequest
|
||||
table: vote_request
|
||||
fields:
|
||||
userId: int
|
||||
quote: Quote
|
||||
upvote: bool
|
||||
|
|
@ -1,30 +1,21 @@
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:serverpod/serverpod.dart';
|
||||
import 'package:wien_talks_server/src/generated/protocol.dart';
|
||||
|
||||
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 {
|
||||
return await Vote.db.find(
|
||||
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';
|
||||
final rows = Vote.db.find(session, limit: 50);
|
||||
return rows;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,146 +1,6 @@
|
|||
{
|
||||
"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
|
||||
},
|
||||
{
|
||||
"name": "serverpod_cloud_storage",
|
||||
"dartName": "CloudStorageEntry",
|
||||
|
|
@ -1277,572 +1137,16 @@
|
|||
}
|
||||
],
|
||||
"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": [
|
||||
{
|
||||
"module": "wien_talks",
|
||||
"version": "20250816215102447"
|
||||
"version": "20250816095813247"
|
||||
},
|
||||
{
|
||||
"module": "serverpod",
|
||||
"version": "20240516151843329"
|
||||
},
|
||||
{
|
||||
"module": "serverpod_auth",
|
||||
"version": "20240520102713718"
|
||||
}
|
||||
],
|
||||
"migrationApiVersion": 1
|
||||
|
|
@ -1,32 +1,5 @@
|
|||
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
|
||||
--
|
||||
|
|
@ -233,118 +206,6 @@ CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USI
|
|||
CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched");
|
||||
CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen");
|
||||
|
||||
--
|
||||
-- Class AuthKey as table serverpod_auth_key
|
||||
--
|
||||
CREATE TABLE "serverpod_auth_key" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"hash" text NOT NULL,
|
||||
"scopeNames" json NOT NULL,
|
||||
"method" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId");
|
||||
|
||||
--
|
||||
-- Class EmailAuth as table serverpod_email_auth
|
||||
--
|
||||
CREATE TABLE "serverpod_email_auth" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"email" text NOT NULL,
|
||||
"hash" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email");
|
||||
|
||||
--
|
||||
-- Class EmailCreateAccountRequest as table serverpod_email_create_request
|
||||
--
|
||||
CREATE TABLE "serverpod_email_create_request" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userName" text NOT NULL,
|
||||
"email" text NOT NULL,
|
||||
"hash" text NOT NULL,
|
||||
"verificationCode" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email");
|
||||
|
||||
--
|
||||
-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in
|
||||
--
|
||||
CREATE TABLE "serverpod_email_failed_sign_in" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"email" text NOT NULL,
|
||||
"time" timestamp without time zone NOT NULL,
|
||||
"ipAddress" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email");
|
||||
CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time");
|
||||
|
||||
--
|
||||
-- Class EmailReset as table serverpod_email_reset
|
||||
--
|
||||
CREATE TABLE "serverpod_email_reset" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"verificationCode" text NOT NULL,
|
||||
"expiration" timestamp without time zone NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode");
|
||||
|
||||
--
|
||||
-- Class GoogleRefreshToken as table serverpod_google_refresh_token
|
||||
--
|
||||
CREATE TABLE "serverpod_google_refresh_token" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"refreshToken" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId");
|
||||
|
||||
--
|
||||
-- Class UserImage as table serverpod_user_image
|
||||
--
|
||||
CREATE TABLE "serverpod_user_image" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"version" bigint NOT NULL,
|
||||
"url" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version");
|
||||
|
||||
--
|
||||
-- Class UserInfo as table serverpod_user_info
|
||||
--
|
||||
CREATE TABLE "serverpod_user_info" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userIdentifier" text NOT NULL,
|
||||
"userName" text,
|
||||
"fullName" text,
|
||||
"email" text,
|
||||
"created" timestamp without time zone NOT NULL,
|
||||
"imageUrl" text,
|
||||
"scopeNames" json NOT NULL,
|
||||
"blocked" boolean NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier");
|
||||
CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email");
|
||||
|
||||
--
|
||||
-- Foreign relations for "serverpod_log" table
|
||||
--
|
||||
|
|
@ -380,9 +241,9 @@ ALTER TABLE ONLY "serverpod_query_log"
|
|||
-- MIGRATION VERSION FOR wien_talks
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('wien_talks', '20250816215102447', now())
|
||||
VALUES ('wien_talks', '20250816095813247', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20250816215102447', "timestamp" = now();
|
||||
DO UPDATE SET "version" = '20250816095813247', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod
|
||||
|
|
@ -392,13 +253,5 @@ INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20240516151843329', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod_auth
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('serverpod_auth', '20240520102713718', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20240520102713718', "timestamp" = now();
|
||||
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"moduleName": "wien_talks",
|
||||
"tables": [],
|
||||
"installedModules": [
|
||||
{
|
||||
"module": "serverpod",
|
||||
"version": "20240516151843329"
|
||||
}
|
||||
],
|
||||
"migrationApiVersion": 1
|
||||
}
|
||||
|
|
@ -1,157 +1,5 @@
|
|||
{
|
||||
"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",
|
||||
"createTable": {
|
||||
|
|
@ -1327,582 +1175,6 @@
|
|||
],
|
||||
"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": [],
|
||||
|
|
@ -1,33 +1,5 @@
|
|||
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
|
||||
--
|
||||
|
|
@ -234,118 +206,6 @@ CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USI
|
|||
CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched");
|
||||
CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_auth_key" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"hash" text NOT NULL,
|
||||
"scopeNames" json NOT NULL,
|
||||
"method" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_email_auth" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"email" text NOT NULL,
|
||||
"hash" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_email_create_request" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userName" text NOT NULL,
|
||||
"email" text NOT NULL,
|
||||
"hash" text NOT NULL,
|
||||
"verificationCode" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_email_failed_sign_in" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"email" text NOT NULL,
|
||||
"time" timestamp without time zone NOT NULL,
|
||||
"ipAddress" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email");
|
||||
CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_email_reset" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"verificationCode" text NOT NULL,
|
||||
"expiration" timestamp without time zone NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_google_refresh_token" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"refreshToken" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_user_image" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"version" bigint NOT NULL,
|
||||
"url" text NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version");
|
||||
|
||||
--
|
||||
-- ACTION CREATE TABLE
|
||||
--
|
||||
CREATE TABLE "serverpod_user_info" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userIdentifier" text NOT NULL,
|
||||
"userName" text,
|
||||
"fullName" text,
|
||||
"email" text,
|
||||
"created" timestamp without time zone NOT NULL,
|
||||
"imageUrl" text,
|
||||
"scopeNames" json NOT NULL,
|
||||
"blocked" boolean NOT NULL
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier");
|
||||
CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email");
|
||||
|
||||
--
|
||||
-- ACTION CREATE FOREIGN KEY
|
||||
--
|
||||
|
|
@ -381,9 +241,9 @@ ALTER TABLE ONLY "serverpod_query_log"
|
|||
-- MIGRATION VERSION FOR wien_talks
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('wien_talks', '20250816212658542', now())
|
||||
VALUES ('wien_talks', '20250816095813247', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20250816212658542', "timestamp" = now();
|
||||
DO UPDATE SET "version" = '20250816095813247', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod
|
||||
|
|
@ -393,13 +253,5 @@ INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
|||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20240516151843329', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod_auth
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('serverpod_auth', '20240520102713718', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20240520102713718', "timestamp" = now();
|
||||
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -92,55 +92,6 @@
|
|||
],
|
||||
"managed": true
|
||||
},
|
||||
{
|
||||
"name": "vote",
|
||||
"dartName": "Vote",
|
||||
"module": "wien_talks",
|
||||
"schema": "public",
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"columnType": 6,
|
||||
"isNullable": false,
|
||||
"columnDefault": "nextval('vote_id_seq'::regclass)",
|
||||
"dartType": "int?"
|
||||
},
|
||||
{
|
||||
"name": "userId",
|
||||
"columnType": 6,
|
||||
"isNullable": false,
|
||||
"dartType": "int"
|
||||
},
|
||||
{
|
||||
"name": "createdAt",
|
||||
"columnType": 4,
|
||||
"isNullable": false,
|
||||
"dartType": "DateTime"
|
||||
},
|
||||
{
|
||||
"name": "upvote",
|
||||
"columnType": 1,
|
||||
"isNullable": false,
|
||||
"dartType": "bool"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [],
|
||||
"indexes": [
|
||||
{
|
||||
"indexName": "vote_pkey",
|
||||
"elements": [
|
||||
{
|
||||
"type": 0,
|
||||
"definition": "id"
|
||||
}
|
||||
],
|
||||
"type": "btree",
|
||||
"isUnique": true,
|
||||
"isPrimary": true
|
||||
}
|
||||
],
|
||||
"managed": true
|
||||
},
|
||||
{
|
||||
"name": "serverpod_cloud_storage",
|
||||
"dartName": "CloudStorageEntry",
|
||||
|
|
@ -1834,7 +1785,7 @@
|
|||
"installedModules": [
|
||||
{
|
||||
"module": "wien_talks",
|
||||
"version": "20250816215049795"
|
||||
"version": "20250816122625449"
|
||||
},
|
||||
{
|
||||
"module": "serverpod",
|
||||
|
|
@ -17,16 +17,6 @@ CREATE TABLE "quote" (
|
|||
"tags" json
|
||||
);
|
||||
|
||||
--
|
||||
-- Class Vote as table vote
|
||||
--
|
||||
CREATE TABLE "vote" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"createdAt" timestamp without time zone NOT NULL,
|
||||
"upvote" boolean NOT NULL
|
||||
);
|
||||
|
||||
--
|
||||
-- Class CloudStorageEntry as table serverpod_cloud_storage
|
||||
--
|
||||
|
|
@ -380,9 +370,9 @@ ALTER TABLE ONLY "serverpod_query_log"
|
|||
-- MIGRATION VERSION FOR wien_talks
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('wien_talks', '20250816215049795', now())
|
||||
VALUES ('wien_talks', '20250816122625449', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20250816215049795', "timestamp" = now();
|
||||
DO UPDATE SET "version" = '20250816122625449', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod
|
||||
|
|
@ -91,55 +91,6 @@
|
|||
}
|
||||
],
|
||||
"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": [
|
||||
|
|
@ -0,0 +1,676 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
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;
|
||||
|
|
@ -92,55 +92,6 @@
|
|||
],
|
||||
"managed": true
|
||||
},
|
||||
{
|
||||
"name": "vote",
|
||||
"dartName": "Vote",
|
||||
"module": "wien_talks",
|
||||
"schema": "public",
|
||||
"columns": [
|
||||
{
|
||||
"name": "id",
|
||||
"columnType": 6,
|
||||
"isNullable": false,
|
||||
"columnDefault": "nextval('vote_id_seq'::regclass)",
|
||||
"dartType": "int?"
|
||||
},
|
||||
{
|
||||
"name": "userId",
|
||||
"columnType": 6,
|
||||
"isNullable": false,
|
||||
"dartType": "int"
|
||||
},
|
||||
{
|
||||
"name": "createdAt",
|
||||
"columnType": 4,
|
||||
"isNullable": false,
|
||||
"dartType": "DateTime"
|
||||
},
|
||||
{
|
||||
"name": "upvote",
|
||||
"columnType": 1,
|
||||
"isNullable": false,
|
||||
"dartType": "bool"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [],
|
||||
"indexes": [
|
||||
{
|
||||
"indexName": "vote_pkey",
|
||||
"elements": [
|
||||
{
|
||||
"type": 0,
|
||||
"definition": "id"
|
||||
}
|
||||
],
|
||||
"type": "btree",
|
||||
"isUnique": true,
|
||||
"isPrimary": true
|
||||
}
|
||||
],
|
||||
"managed": true
|
||||
},
|
||||
{
|
||||
"name": "serverpod_cloud_storage",
|
||||
"dartName": "CloudStorageEntry",
|
||||
|
|
@ -1834,7 +1785,7 @@
|
|||
"installedModules": [
|
||||
{
|
||||
"module": "wien_talks",
|
||||
"version": "20250816215043551"
|
||||
"version": "20250816171653001"
|
||||
},
|
||||
{
|
||||
"module": "serverpod",
|
||||
|
|
@ -17,16 +17,6 @@ CREATE TABLE "quote" (
|
|||
"tags" json
|
||||
);
|
||||
|
||||
--
|
||||
-- Class Vote as table vote
|
||||
--
|
||||
CREATE TABLE "vote" (
|
||||
"id" bigserial PRIMARY KEY,
|
||||
"userId" bigint NOT NULL,
|
||||
"createdAt" timestamp without time zone NOT NULL,
|
||||
"upvote" boolean NOT NULL
|
||||
);
|
||||
|
||||
--
|
||||
-- Class CloudStorageEntry as table serverpod_cloud_storage
|
||||
--
|
||||
|
|
@ -380,9 +370,9 @@ ALTER TABLE ONLY "serverpod_query_log"
|
|||
-- MIGRATION VERSION FOR wien_talks
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('wien_talks', '20250816214717668', now())
|
||||
VALUES ('wien_talks', '20250816171653001', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20250816214717668', "timestamp" = now();
|
||||
DO UPDATE SET "version" = '20250816171653001', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod
|
||||
|
|
@ -91,55 +91,6 @@
|
|||
}
|
||||
],
|
||||
"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": [
|
||||
|
|
@ -5,9 +5,9 @@ BEGIN;
|
|||
-- MIGRATION VERSION FOR wien_talks
|
||||
--
|
||||
INSERT INTO "serverpod_migrations" ("module", "version", "timestamp")
|
||||
VALUES ('wien_talks', '20250816212959541', now())
|
||||
VALUES ('wien_talks', '20250816171653001', now())
|
||||
ON CONFLICT ("module")
|
||||
DO UPDATE SET "version" = '20250816212959541', "timestamp" = now();
|
||||
DO UPDATE SET "version" = '20250816171653001', "timestamp" = now();
|
||||
|
||||
--
|
||||
-- MIGRATION VERSION FOR serverpod
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,405 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,405 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,156 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,404 +0,0 @@
|
|||
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', '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;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"actions": [],
|
||||
"warnings": [],
|
||||
"migrationApiVersion": 1
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"actions": [],
|
||||
"warnings": [],
|
||||
"migrationApiVersion": 1
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,156 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"actions": [],
|
||||
"warnings": [],
|
||||
"migrationApiVersion": 1
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
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
|
|
@ -1,414 +0,0 @@
|
|||
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;
|
||||
|
|
@ -1,205 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
{
|
||||
"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
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
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;
|
||||
|
|
@ -4,10 +4,6 @@
|
|||
### manually. If a collision is detected in this file when doing a code merge, resolve
|
||||
### the conflict by removing and recreating the conflicting migration.
|
||||
|
||||
20250816212658542
|
||||
20250816212959541
|
||||
20250816214717668
|
||||
20250816215043551
|
||||
20250816215049795
|
||||
20250816215102447
|
||||
20250816220051483
|
||||
20250816095813247
|
||||
20250816122625449
|
||||
20250816171653001
|
||||
|
|
|
|||
|
|
@ -14,10 +14,11 @@
|
|||
import 'package:serverpod_test/serverpod_test.dart' as _i1;
|
||||
import 'package:serverpod/serverpod.dart' as _i2;
|
||||
import 'dart:async' as _i3;
|
||||
import 'package:wien_talks_server/src/generated/health.dart' as _i4;
|
||||
import 'package:wien_talks_server/src/generated/quote.dart' as _i5;
|
||||
import 'package:wien_talks_server/src/generated/create_quote.dart' as _i6;
|
||||
import 'package:wien_talks_server/src/generated/vote.dart' as _i7;
|
||||
import 'package:wien_talks_server/src/generated/quotes/quote.dart' as _i4;
|
||||
import 'package:wien_talks_server/src/generated/quotes/create_quote.dart'
|
||||
as _i5;
|
||||
import 'package:wien_talks_server/src/generated/votes/vote.dart' as _i6;
|
||||
import 'package:wien_talks_server/src/generated/votes/vote_request.dart' as _i7;
|
||||
import 'package:wien_talks_server/src/generated/protocol.dart';
|
||||
import 'package:wien_talks_server/src/generated/endpoints.dart';
|
||||
export 'package:serverpod_test/serverpod_test_public_exports.dart';
|
||||
|
|
@ -104,8 +105,6 @@ void withServerpod(
|
|||
}
|
||||
|
||||
class TestEndpoints {
|
||||
late final _HealthEndpoint health;
|
||||
|
||||
late final _QuoteEndpoint quote;
|
||||
|
||||
late final _VotesEndpoint votes;
|
||||
|
|
@ -118,10 +117,6 @@ class _InternalTestEndpoints extends TestEndpoints
|
|||
_i2.SerializationManager serializationManager,
|
||||
_i2.EndpointDispatch endpoints,
|
||||
) {
|
||||
health = _HealthEndpoint(
|
||||
endpoints,
|
||||
serializationManager,
|
||||
);
|
||||
quote = _QuoteEndpoint(
|
||||
endpoints,
|
||||
serializationManager,
|
||||
|
|
@ -133,73 +128,6 @@ 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 {
|
||||
_QuoteEndpoint(
|
||||
this._endpointDispatch,
|
||||
|
|
@ -210,35 +138,9 @@ class _QuoteEndpoint {
|
|||
|
||||
final _i2.SerializationManager _serializationManager;
|
||||
|
||||
_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(
|
||||
_i3.Future<_i4.Quote> createQuote(
|
||||
_i1.TestSessionBuilder sessionBuilder,
|
||||
_i6.CreateQuoteRequest req,
|
||||
_i5.CreateQuoteRequest req,
|
||||
) async {
|
||||
return _i1.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
|
|
@ -257,7 +159,7 @@ class _QuoteEndpoint {
|
|||
var _localReturnValue = await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
) as _i3.Future<_i5.Quote>);
|
||||
) as _i3.Future<_i4.Quote>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
|
|
@ -267,7 +169,7 @@ class _QuoteEndpoint {
|
|||
|
||||
_i3.Future<void> updateQuote(
|
||||
_i1.TestSessionBuilder sessionBuilder,
|
||||
_i5.Quote quote,
|
||||
_i4.Quote quote,
|
||||
) async {
|
||||
return _i1.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
|
|
@ -294,7 +196,7 @@ class _QuoteEndpoint {
|
|||
});
|
||||
}
|
||||
|
||||
_i3.Future<List<_i5.Quote>> getAllQuotes(
|
||||
_i3.Future<List<_i4.Quote>> getAllQuotes(
|
||||
_i1.TestSessionBuilder sessionBuilder) async {
|
||||
return _i1.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
|
|
@ -313,7 +215,7 @@ class _QuoteEndpoint {
|
|||
var _localReturnValue = await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
) as _i3.Future<List<_i5.Quote>>);
|
||||
) as _i3.Future<List<_i4.Quote>>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
|
|
@ -332,7 +234,36 @@ class _VotesEndpoint {
|
|||
|
||||
final _i2.SerializationManager _serializationManager;
|
||||
|
||||
_i3.Future<List<_i7.Vote>> getAllVotes(
|
||||
_i3.Future<_i6.Vote> postVote(
|
||||
_i1.TestSessionBuilder sessionBuilder,
|
||||
_i7.VoteRequest voteRequest,
|
||||
) async {
|
||||
return _i1.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
(sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild(
|
||||
endpoint: 'votes',
|
||||
method: 'postVote',
|
||||
);
|
||||
try {
|
||||
var _localCallContext = await _endpointDispatch.getMethodCallContext(
|
||||
createSessionCallback: (_) => _localUniqueSession,
|
||||
endpointPath: 'votes',
|
||||
methodName: 'postVote',
|
||||
parameters: _i1.testObjectToJson({'voteRequest': voteRequest}),
|
||||
serializationManager: _serializationManager,
|
||||
);
|
||||
var _localReturnValue = await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
) as _i3.Future<_i6.Vote>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_i3.Future<List<_i6.Vote>> getAllVotes(
|
||||
_i1.TestSessionBuilder sessionBuilder) async {
|
||||
return _i1.callAwaitableFunctionAndHandleExceptions(() async {
|
||||
var _localUniqueSession =
|
||||
|
|
@ -351,59 +282,7 @@ class _VotesEndpoint {
|
|||
var _localReturnValue = await (_localCallContext.method.call(
|
||||
_localUniqueSession,
|
||||
_localCallContext.arguments,
|
||||
) 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>);
|
||||
) as _i3.Future<List<_i6.Vote>>);
|
||||
return _localReturnValue;
|
||||
} finally {
|
||||
await _localUniqueSession.close();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue