diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8276f97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +wien_talks/wien_talks_flutter/pubspec.lock +wien_talks/wien_talks_flutter/android/app/google-services.json +*.pptx# diff --git a/wien_talks/.github/workflows/deployment-aws.yml b/wien_talks/.github/workflows/deployment-aws.yml new file mode 100644 index 0000000..ea95cd7 --- /dev/null +++ b/wien_talks/.github/workflows/deployment-aws.yml @@ -0,0 +1,75 @@ +name: Deploy to AWS +on: + push: + branches: [ deployment-aws-production, deployment-aws-staging ] + workflow_dispatch: + inputs: + target: + description: 'Target' + required: true + default: 'production' + type: choice + options: + - 'staging' + - 'production' +jobs: + deploy: + name: Deploy to AWS + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup Dart SDK + uses: dart-lang/setup-dart@v1.6.5 + with: + sdk: 3.5 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2 + + - name: Create passwords file + working-directory: wien_talks_server + shell: bash + env: + SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} + run: | + pwd + echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml + ls config/ + + - name: Get Dart packages + working-directory: wien_talks_server + run: dart pub get + + - name: Compile server + working-directory: wien_talks_server + run: dart compile kernel bin/main.dart + + - name: Create CodeDeploy Deployment + id: deploy + env: + PROJECT_NAME: wien_talks + AWS_NAME: wien-talks + DEPLOYMENT_BUCKET: wien-talks-deployment-6559518 + TARGET: ${{ github.event.inputs.target }} + run: | + # Deploy server to AWS + TARGET="${TARGET:=${GITHUB_REF##*-}}" + echo "Deploying to target: $TARGET" + mkdir -p vendor + cp "${PROJECT_NAME}_server/deploy/aws/scripts/appspec.yml" appspec.yml + zip -r deployment.zip . + aws s3 cp deployment.zip "s3://${DEPLOYMENT_BUCKET}/deployment.zip" + aws deploy create-deployment \ + --application-name "${AWS_NAME}-app" \ + --deployment-group-name "${AWS_NAME}-${TARGET}-group" \ + --deployment-config-name CodeDeployDefault.OneAtATime \ + --s3-location "bucket=${DEPLOYMENT_BUCKET},key=deployment.zip,bundleType=zip" diff --git a/wien_talks/.github/workflows/deployment-gcp.yml b/wien_talks/.github/workflows/deployment-gcp.yml new file mode 100644 index 0000000..6ceedf2 --- /dev/null +++ b/wien_talks/.github/workflows/deployment-gcp.yml @@ -0,0 +1,99 @@ +name: Deploy to GCP +on: + push: + branches: [ deployment-gcp-production, deployment-gcp-staging ] + workflow_dispatch: + inputs: + target: + description: 'Target' + required: true + default: 'production' + type: choice + options: + - 'staging' + - 'production' + +env: + # TODO: Update with your Google Cloud project id. If you have changed the + # region and zone in your Terraform configuration, you will need to change + # it here too. + PROJECT: "" + REGION: us-central1 + ZONE: us-central1-c + +jobs: + deploy: + name: Deploy to Google Cloud Run + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setting Target Mode from Input + if: ${{ github.event.inputs.target != '' }} + run: echo "TARGET=${{ github.event.inputs.target }}" >> $GITHUB_ENV + + - name: Setting Target mode based on branch + if: ${{ github.event.inputs.target == '' }} + run: echo "TARGET=${GITHUB_REF##*-}" >> $GITHUB_ENV + + - name: Set repository + run: echo "REPOSITORY=serverpod-${{ env.TARGET }}-container" >> $GITHUB_ENV + + - name: Set Image Name + run: echo "IMAGE_NAME=serverpod" >> $GITHUB_ENV + + - name: Set Service Name + run: echo "SERVICE_NAME=$(echo $IMAGE_NAME | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV + + - name: Test + run: echo $SERVICE_NAME + + + - id: "auth" + name: "Authenticate to Google Cloud" + uses: "google-github-actions/auth@v1" + with: + credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}" + + - name: Create passwords file + working-directory: wien_talks_server + shell: bash + env: + SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} + run: | + pwd + echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml + ls config/ + + - name: Configure Docker + working-directory: wien_talks_server + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev + + - name: Build the Docker image + working-directory: wien_talks_server + run: "docker build -t $IMAGE_NAME ." + + - name: Tag the Docker image + working-directory: wien_talks_server + run: docker tag $IMAGE_NAME ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME + + - name: Push Docker image + working-directory: wien_talks_server + run: docker push ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME + + # Uncomment the following code to automatically restart the servers in the + # instance group when you push a new version of your code. Before doing + # this, make sure that you have successfully deployed a first version. + # + # - name: Restart servers in instance group + # run: | + # gcloud compute instance-groups managed rolling-action replace serverpod-${{ env.TARGET }}-group \ + # --project=${{ env.PROJECT }} \ + # --replacement-method='substitute' \ + # --max-surge=1 \ + # --max-unavailable=1 \ + # --zone=${{ env.ZONE }} diff --git a/wien_talks/FunMap_Presentation.pptx b/wien_talks/FunMap_Presentation.pptx new file mode 100644 index 0000000..96ac4e9 Binary files /dev/null and b/wien_talks/FunMap_Presentation.pptx differ diff --git a/wien_talks/Makefile b/wien_talks/Makefile new file mode 100644 index 0000000..828334e --- /dev/null +++ b/wien_talks/Makefile @@ -0,0 +1,7 @@ +include defines.mk + + +.PHONY: local +local: + $(MAKE) -C wien_talks_server local + diff --git a/wien_talks/README.md b/wien_talks/README.md deleted file mode 100644 index a9ed39d..0000000 --- a/wien_talks/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# wien_talks - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/wien_talks/defines.mk b/wien_talks/defines.mk new file mode 100644 index 0000000..e69de29 diff --git a/wien_talks/lib/main.dart b/wien_talks/lib/main.dart deleted file mode 100644 index 7b7f5b6..0000000 --- a/wien_talks/lib/main.dart +++ /dev/null @@ -1,122 +0,0 @@ -import 'package:flutter/material.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({super.key}); - - // This widget is the root of your application. - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Flutter Demo', - theme: ThemeData( - // This is the theme of your application. - // - // TRY THIS: Try running your application with "flutter run". You'll see - // the application has a purple toolbar. Then, without quitting the app, - // try changing the seedColor in the colorScheme below to Colors.green - // and then invoke "hot reload" (save your changes or press the "hot - // reload" button in a Flutter-supported IDE, or press "r" if you used - // the command line to start the app). - // - // Notice that the counter didn't reset back to zero; the application - // state is not lost during the reload. To reset the state, use hot - // restart instead. - // - // This works for code too, not just values: Most code changes can be - // tested with just a hot reload. - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - ), - home: const MyHomePage(title: 'Flutter Demo Home Page'), - ); - } -} - -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - int _counter = 0; - - void _incrementCounter() { - setState(() { - // This call to setState tells the Flutter framework that something has - // changed in this State, which causes it to rerun the build method below - // so that the display can reflect the updated values. If we changed - // _counter without calling setState(), then the build method would not be - // called again, and so nothing would appear to happen. - _counter++; - }); - } - - @override - Widget build(BuildContext context) { - // This method is rerun every time setState is called, for instance as done - // by the _incrementCounter method above. - // - // The Flutter framework has been optimized to make rerunning build methods - // fast, so that you can just rebuild anything that needs updating rather - // than having to individually change instances of widgets. - return Scaffold( - appBar: AppBar( - // TRY THIS: Try changing the color here to a specific color (to - // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar - // change color while the other colors stay the same. - backgroundColor: Theme.of(context).colorScheme.inversePrimary, - // Here we take the value from the MyHomePage object that was created by - // the App.build method, and use it to set our appbar title. - title: Text(widget.title), - ), - body: Center( - // Center is a layout widget. It takes a single child and positions it - // in the middle of the parent. - child: Column( - // Column is also a layout widget. It takes a list of children and - // arranges them vertically. By default, it sizes itself to fit its - // children horizontally, and tries to be as tall as its parent. - // - // Column has various properties to control how it sizes itself and - // how it positions its children. Here we use mainAxisAlignment to - // center the children vertically; the main axis here is the vertical - // axis because Columns are vertical (the cross axis would be - // horizontal). - // - // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint" - // action in the IDE, or press "p" in the console), to see the - // wireframe for each widget. - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Text('You have pushed the button this many times:'), - Text( - '$_counter', - style: Theme.of(context).textTheme.headlineMedium, - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _incrementCounter, - tooltip: 'Increment', - child: const Icon(Icons.add), - ), // This trailing comma makes auto-formatting nicer for build methods. - ); - } -} diff --git a/wien_talks/pubspec.yaml b/wien_talks/pubspec.yaml deleted file mode 100644 index 63ea52d..0000000 --- a/wien_talks/pubspec.yaml +++ /dev/null @@ -1,89 +0,0 @@ -name: wien_talks -description: "A new Flutter project." -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -# In Windows, build-name is used as the major, minor, and patch parts -# of the product and file versions while build-number is used as the build suffix. -version: 1.0.0+1 - -environment: - sdk: ^3.8.1 - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.8 - -dev_dependencies: - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^5.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/to/resolution-aware-images - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/to/asset-from-package - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/to/font-from-package diff --git a/wien_talks/test/widget_test.dart b/wien_talks/test/widget_test.dart deleted file mode 100644 index a94c8c6..0000000 --- a/wien_talks/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:wien_talks/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/wien_talks/wien_talks_client/.gitignore b/wien_talks/wien_talks_client/.gitignore new file mode 100644 index 0000000..a375a6b --- /dev/null +++ b/wien_talks/wien_talks_client/.gitignore @@ -0,0 +1,13 @@ +# Files and directories created by pub +.dart_tool/ +.packages + +# Omit committing pubspec.lock for library packages: +# https://dart.dev/guides/libraries/private-files#pubspeclock +pubspec.lock + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ diff --git a/wien_talks/wien_talks_client/.idea/.gitignore b/wien_talks/wien_talks_client/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/wien_talks/wien_talks_client/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/wien_talks/wien_talks_client/.idea/caches/deviceStreaming.xml b/wien_talks/wien_talks_client/.idea/caches/deviceStreaming.xml new file mode 100644 index 0000000..9aaec77 --- /dev/null +++ b/wien_talks/wien_talks_client/.idea/caches/deviceStreaming.xml @@ -0,0 +1,835 @@ + + + + + + \ No newline at end of file diff --git a/wien_talks/wien_talks_client/.idea/misc.xml b/wien_talks/wien_talks_client/.idea/misc.xml new file mode 100644 index 0000000..1945ce5 --- /dev/null +++ b/wien_talks/wien_talks_client/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/wien_talks/wien_talks_client/.idea/modules.xml b/wien_talks/wien_talks_client/.idea/modules.xml new file mode 100644 index 0000000..317fd21 --- /dev/null +++ b/wien_talks/wien_talks_client/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/wien_talks/wien_talks_client/.idea/vcs.xml b/wien_talks/wien_talks_client/.idea/vcs.xml new file mode 100644 index 0000000..b2bdec2 --- /dev/null +++ b/wien_talks/wien_talks_client/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/wien_talks/wien_talks_client/.idea/wien_talks_client.iml b/wien_talks/wien_talks_client/.idea/wien_talks_client.iml new file mode 100644 index 0000000..0cf94bd --- /dev/null +++ b/wien_talks/wien_talks_client/.idea/wien_talks_client.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/wien_talks/wien_talks_client/CHANGELOG.md b/wien_talks/wien_talks_client/CHANGELOG.md new file mode 100644 index 0000000..687440b --- /dev/null +++ b/wien_talks/wien_talks_client/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version, created by Stagehand diff --git a/wien_talks/wien_talks_client/README.md b/wien_talks/wien_talks_client/README.md new file mode 100644 index 0000000..37150ed --- /dev/null +++ b/wien_talks/wien_talks_client/README.md @@ -0,0 +1,5 @@ +# wien_talks_client + +This is your Serverpod client. The code in here is mostly generated by +Serverpod, but you may want to make changes if you are adding modules to your +project. diff --git a/wien_talks/wien_talks_client/analysis_options.yaml b/wien_talks/wien_talks_client/analysis_options.yaml new file mode 100644 index 0000000..8d78563 --- /dev/null +++ b/wien_talks/wien_talks_client/analysis_options.yaml @@ -0,0 +1,13 @@ +# Defines a default set of lint rules enforced for +# projects at Google. For details and rationale, +# see https://github.com/dart-lang/pedantic#enabled-lints. + +# For lint rules and documentation, see http://dart-lang.github.io/linter/lints. +# Uncomment to specify additional rules. +# linter: +# rules: +# - camel_case_types + +analyzer: + exclude: + - lib/src/protocol/** diff --git a/wien_talks/wien_talks_client/dartdoc_options.yaml b/wien_talks/wien_talks_client/dartdoc_options.yaml new file mode 100644 index 0000000..035db99 --- /dev/null +++ b/wien_talks/wien_talks_client/dartdoc_options.yaml @@ -0,0 +1,5 @@ +dartdoc: + categories: + "Endpoint": + markdown: doc/endpoint.md + name: Endpoint \ No newline at end of file diff --git a/wien_talks/wien_talks_client/doc/endpoint.md b/wien_talks/wien_talks_client/doc/endpoint.md new file mode 100644 index 0000000..8582b12 --- /dev/null +++ b/wien_talks/wien_talks_client/doc/endpoint.md @@ -0,0 +1,15 @@ +# Callable endpoints + +Each class contains callable methods that will call a method on the server side. These are normally defined in the `endpoint` directory in your server project. This client sends requests to these endpoints and returns the result. + +Example usage: + +```dart +// How to use GreetingEndpoint. +client.greeting.hello("world!"); + +// Generic format. +client..(...); +``` + +Please see the full official documentation [here](https://docs.serverpod.dev) diff --git a/wien_talks/wien_talks_client/lib/src/protocol/client.dart b/wien_talks/wien_talks_client/lib/src/protocol/client.dart new file mode 100644 index 0000000..80b8565 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/client.dart @@ -0,0 +1,165 @@ +/* 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 '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:serverpod_auth_client/serverpod_auth_client.dart' as _i7; +import 'protocol.dart' as _i8; + +/// {@category Endpoint} +class EndpointHealth extends _i1.EndpointRef { + EndpointHealth(_i1.EndpointCaller caller) : super(caller); + + @override + String get name => 'health'; + + _i2.Future<_i3.Health> ping({String? note}) => + caller.callServerEndpoint<_i3.Health>( + 'health', + 'ping', + {'note': note}, + ); + + _i2.Future> all() => + caller.callServerEndpoint>( + 'health', + 'all', + {}, + ); +} + +/// {@category Endpoint} +class EndpointQuote extends _i1.EndpointRef { + EndpointQuote(_i1.EndpointCaller caller) : super(caller); + + @override + String get name => 'quote'; + + _i2.Future<_i4.Quote> createQuote(_i5.CreateQuoteRequest req) => + caller.callServerEndpoint<_i4.Quote>( + 'quote', + 'createQuote', + {'req': req}, + ); + + _i2.Future updateQuote(_i4.Quote quote) => + caller.callServerEndpoint( + 'quote', + 'updateQuote', + {'quote': quote}, + ); + + _i2.Future> getAllQuotes() => + caller.callServerEndpoint>( + 'quote', + 'getAllQuotes', + {}, + ); + + _i2.Stream<_i4.Quote> streamAllQuotes({required int limit}) => + caller.callStreamingServerEndpoint<_i2.Stream<_i4.Quote>, _i4.Quote>( + 'quote', + 'streamAllQuotes', + {'limit': limit}, + {}, + ); +} + +/// {@category Endpoint} +class EndpointVotes extends _i1.EndpointRef { + EndpointVotes(_i1.EndpointCaller caller) : super(caller); + + @override + String get name => 'votes'; + + _i2.Future> getAllVotes() => + caller.callServerEndpoint>( + 'votes', + 'getAllVotes', + {}, + ); + + _i2.Future createVote() => caller.callServerEndpoint( + 'votes', + 'createVote', + {}, + ); + + _i2.Future sayHello() => caller.callServerEndpoint( + 'votes', + 'sayHello', + {}, + ); +} + +class Modules { + Modules(Client client) { + auth = _i7.Caller(client); + } + + late final _i7.Caller auth; +} + +class Client extends _i1.ServerpodClientShared { + Client( + String host, { + dynamic securityContext, + _i1.AuthenticationKeyManager? authenticationKeyManager, + Duration? streamingConnectionTimeout, + Duration? connectionTimeout, + Function( + _i1.MethodCallContext, + Object, + StackTrace, + )? onFailedCall, + Function(_i1.MethodCallContext)? onSucceededCall, + bool? disconnectStreamsOnLostInternetConnection, + }) : super( + host, + _i8.Protocol(), + securityContext: securityContext, + authenticationKeyManager: authenticationKeyManager, + streamingConnectionTimeout: streamingConnectionTimeout, + connectionTimeout: connectionTimeout, + onFailedCall: onFailedCall, + onSucceededCall: onSucceededCall, + 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; + + late final Modules modules; + + @override + Map get endpointRefLookup => { + 'health': health, + 'quote': quote, + 'votes': votes, + }; + + @override + Map get moduleLookup => + {'auth': modules.auth}; +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/create_quote.dart b/wien_talks/wien_talks_client/lib/src/protocol/create_quote.dart new file mode 100644 index 0000000..8331a85 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/create_quote.dart @@ -0,0 +1,116 @@ +/* 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 CreateQuoteRequest implements _i1.SerializableModel { + CreateQuoteRequest._({ + required this.text, + this.authorName, + required this.lat, + required this.lng, + this.tags, + }); + + factory CreateQuoteRequest({ + required String text, + String? authorName, + required double lat, + required double lng, + List? tags, + }) = _CreateQuoteRequestImpl; + + factory CreateQuoteRequest.fromJson(Map jsonSerialization) { + return CreateQuoteRequest( + text: jsonSerialization['text'] as String, + authorName: jsonSerialization['authorName'] as String?, + lat: (jsonSerialization['lat'] as num).toDouble(), + lng: (jsonSerialization['lng'] as num).toDouble(), + tags: (jsonSerialization['tags'] as List?) + ?.map((e) => e as String) + .toList(), + ); + } + + String text; + + String? authorName; + + double lat; + + double lng; + + List? tags; + + /// Returns a shallow copy of this [CreateQuoteRequest] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + CreateQuoteRequest copyWith({ + String? text, + String? authorName, + double? lat, + double? lng, + List? tags, + }); + @override + Map toJson() { + return { + 'text': text, + if (authorName != null) 'authorName': authorName, + 'lat': lat, + 'lng': lng, + if (tags != null) 'tags': tags?.toJson(), + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _CreateQuoteRequestImpl extends CreateQuoteRequest { + _CreateQuoteRequestImpl({ + required String text, + String? authorName, + required double lat, + required double lng, + List? tags, + }) : super._( + text: text, + authorName: authorName, + lat: lat, + lng: lng, + tags: tags, + ); + + /// Returns a shallow copy of this [CreateQuoteRequest] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + CreateQuoteRequest copyWith({ + String? text, + Object? authorName = _Undefined, + double? lat, + double? lng, + Object? tags = _Undefined, + }) { + return CreateQuoteRequest( + text: text ?? this.text, + authorName: authorName is String? ? authorName : this.authorName, + lat: lat ?? this.lat, + lng: lng ?? this.lng, + tags: tags is List? ? tags : this.tags?.map((e0) => e0).toList(), + ); + } +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/health.dart b/wien_talks/wien_talks_client/lib/src/protocol/health.dart new file mode 100644 index 0000000..e16054f --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/health.dart @@ -0,0 +1,96 @@ +/* AUTOMATICALLY GENERATED CODE DO NOT MODIFY */ +/* To generate run: "serverpod generate" */ + +// ignore_for_file: implementation_imports +// ignore_for_file: library_private_types_in_public_api +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: public_member_api_docs +// ignore_for_file: type_literal_in_constant_pattern +// ignore_for_file: use_super_parameters + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'package:serverpod_client/serverpod_client.dart' as _i1; + +abstract class Health implements _i1.SerializableModel { + Health._({ + this.id, + required this.createdAt, + this.note, + }); + + factory Health({ + int? id, + required DateTime createdAt, + String? note, + }) = _HealthImpl; + + factory Health.fromJson(Map jsonSerialization) { + return Health( + id: jsonSerialization['id'] as int?, + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + note: jsonSerialization['note'] as String?, + ); + } + + /// The database id, set if the object has been inserted into the + /// database or if it has been fetched from the database. Otherwise, + /// the id will be null. + int? id; + + DateTime createdAt; + + String? note; + + /// Returns a shallow copy of this [Health] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Health copyWith({ + int? id, + DateTime? createdAt, + String? note, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'createdAt': createdAt.toJson(), + if (note != null) 'note': note, + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _HealthImpl extends Health { + _HealthImpl({ + int? id, + required DateTime createdAt, + String? note, + }) : super._( + id: id, + createdAt: createdAt, + note: note, + ); + + /// Returns a shallow copy of this [Health] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Health copyWith({ + Object? id = _Undefined, + DateTime? createdAt, + Object? note = _Undefined, + }) { + return Health( + id: id is int? ? id : this.id, + createdAt: createdAt ?? this.createdAt, + note: note is String? ? note : this.note, + ); + } +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart b/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart new file mode 100644 index 0000000..23f8d65 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/protocol.dart @@ -0,0 +1,137 @@ +/* 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 'create_quote.dart' as _i2; +import 'health.dart' as _i3; +import 'quote.dart' as _i4; +import 'vote.dart' as _i5; +import 'package:wien_talks_client/src/protocol/health.dart' as _i6; +import 'package:wien_talks_client/src/protocol/quote.dart' as _i7; +import 'package:wien_talks_client/src/protocol/vote.dart' as _i8; +import 'package:serverpod_auth_client/serverpod_auth_client.dart' as _i9; +export 'create_quote.dart'; +export 'health.dart'; +export 'quote.dart'; +export 'vote.dart'; +export 'client.dart'; + +class Protocol extends _i1.SerializationManager { + Protocol._(); + + factory Protocol() => _instance; + + static final Protocol _instance = Protocol._(); + + @override + T deserialize( + dynamic data, [ + Type? t, + ]) { + t ??= T; + if (t == _i2.CreateQuoteRequest) { + return _i2.CreateQuoteRequest.fromJson(data) as T; + } + if (t == _i3.Health) { + return _i3.Health.fromJson(data) as T; + } + if (t == _i4.Quote) { + return _i4.Quote.fromJson(data) as T; + } + if (t == _i5.Vote) { + return _i5.Vote.fromJson(data) as T; + } + if (t == _i1.getType<_i2.CreateQuoteRequest?>()) { + return (data != null ? _i2.CreateQuoteRequest.fromJson(data) : null) as T; + } + if (t == _i1.getType<_i3.Health?>()) { + return (data != null ? _i3.Health.fromJson(data) : null) as T; + } + if (t == _i1.getType<_i4.Quote?>()) { + return (data != null ? _i4.Quote.fromJson(data) : null) as T; + } + if (t == _i1.getType<_i5.Vote?>()) { + return (data != null ? _i5.Vote.fromJson(data) : null) as T; + } + if (t == _i1.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(e)).toList() + : null) as T; + } + if (t == _i1.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(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<_i7.Quote>) { + return (data as List).map((e) => deserialize<_i7.Quote>(e)).toList() as T; + } + if (t == List<_i8.Vote>) { + return (data as List).map((e) => deserialize<_i8.Vote>(e)).toList() as T; + } + try { + return _i9.Protocol().deserialize(data, t); + } on _i1.DeserializationTypeNotFoundException catch (_) {} + return super.deserialize(data, t); + } + + @override + String? getClassNameForObject(Object? data) { + String? className = super.getClassNameForObject(data); + if (className != null) return className; + if (data is _i2.CreateQuoteRequest) { + return 'CreateQuoteRequest'; + } + if (data is _i3.Health) { + return 'Health'; + } + if (data is _i4.Quote) { + return 'Quote'; + } + if (data is _i5.Vote) { + return 'Vote'; + } + className = _i9.Protocol().getClassNameForObject(data); + if (className != null) { + return 'serverpod_auth.$className'; + } + return null; + } + + @override + dynamic deserializeByClassName(Map data) { + var dataClassName = data['className']; + if (dataClassName is! String) { + return super.deserializeByClassName(data); + } + 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']); + } + if (dataClassName == 'Vote') { + return deserialize<_i5.Vote>(data['data']); + } + if (dataClassName.startsWith('serverpod_auth.')) { + data['className'] = dataClassName.substring(15); + return _i9.Protocol().deserializeByClassName(data); + } + return super.deserializeByClassName(data); + } +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/quote.dart b/wien_talks/wien_talks_client/lib/src/protocol/quote.dart new file mode 100644 index 0000000..099720f --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/quote.dart @@ -0,0 +1,186 @@ +/* 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 Quote implements _i1.SerializableModel { + Quote._({ + this.id, + required this.userId, + required this.text, + this.authorName, + required this.lat, + required this.long, + required this.createdAt, + required this.visibility, + required this.upvotes, + required this.downvotes, + this.tags, + }); + + factory Quote({ + int? id, + required int userId, + required String text, + String? authorName, + required double lat, + required double long, + required DateTime createdAt, + required int visibility, + required int upvotes, + required int downvotes, + List? tags, + }) = _QuoteImpl; + + factory Quote.fromJson(Map jsonSerialization) { + return Quote( + id: jsonSerialization['id'] as int?, + userId: jsonSerialization['userId'] as int, + text: jsonSerialization['text'] as String, + authorName: jsonSerialization['authorName'] as String?, + lat: (jsonSerialization['lat'] as num).toDouble(), + long: (jsonSerialization['long'] as num).toDouble(), + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + visibility: jsonSerialization['visibility'] as int, + upvotes: jsonSerialization['upvotes'] as int, + downvotes: jsonSerialization['downvotes'] as int, + tags: (jsonSerialization['tags'] as List?) + ?.map((e) => e as String) + .toList(), + ); + } + + /// 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; + + String text; + + String? authorName; + + double lat; + + double long; + + DateTime createdAt; + + int visibility; + + int upvotes; + + int downvotes; + + List? tags; + + /// Returns a shallow copy of this [Quote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Quote copyWith({ + int? id, + int? userId, + String? text, + String? authorName, + double? lat, + double? long, + DateTime? createdAt, + int? visibility, + int? upvotes, + int? downvotes, + List? tags, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'userId': userId, + 'text': text, + if (authorName != null) 'authorName': authorName, + 'lat': lat, + 'long': long, + 'createdAt': createdAt.toJson(), + 'visibility': visibility, + 'upvotes': upvotes, + 'downvotes': downvotes, + if (tags != null) 'tags': tags?.toJson(), + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _QuoteImpl extends Quote { + _QuoteImpl({ + int? id, + required int userId, + required String text, + String? authorName, + required double lat, + required double long, + required DateTime createdAt, + required int visibility, + required int upvotes, + required int downvotes, + List? tags, + }) : super._( + id: id, + userId: userId, + text: text, + authorName: authorName, + lat: lat, + long: long, + createdAt: createdAt, + visibility: visibility, + upvotes: upvotes, + downvotes: downvotes, + tags: tags, + ); + + /// Returns a shallow copy of this [Quote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Quote copyWith({ + Object? id = _Undefined, + int? userId, + String? text, + Object? authorName = _Undefined, + double? lat, + double? long, + DateTime? createdAt, + int? visibility, + int? upvotes, + int? downvotes, + Object? tags = _Undefined, + }) { + return Quote( + id: id is int? ? id : this.id, + userId: userId ?? this.userId, + text: text ?? this.text, + authorName: authorName is String? ? authorName : this.authorName, + lat: lat ?? this.lat, + long: long ?? this.long, + createdAt: createdAt ?? this.createdAt, + visibility: visibility ?? this.visibility, + upvotes: upvotes ?? this.upvotes, + downvotes: downvotes ?? this.downvotes, + tags: tags is List? ? tags : this.tags?.map((e0) => e0).toList(), + ); + } +} diff --git a/wien_talks/wien_talks_client/lib/src/protocol/vote.dart b/wien_talks/wien_talks_client/lib/src/protocol/vote.dart new file mode 100644 index 0000000..3bb8102 --- /dev/null +++ b/wien_talks/wien_talks_client/lib/src/protocol/vote.dart @@ -0,0 +1,118 @@ +/* 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 Vote implements _i1.SerializableModel { + Vote._({ + this.id, + required this.userId, + required this.createdAt, + required this.quoteId, + required this.upvote, + }); + + factory Vote({ + int? id, + required int userId, + required DateTime createdAt, + required int quoteId, + required bool upvote, + }) = _VoteImpl; + + factory Vote.fromJson(Map jsonSerialization) { + return Vote( + id: jsonSerialization['id'] as int?, + userId: jsonSerialization['userId'] as int, + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + quoteId: jsonSerialization['quoteId'] as int, + 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; + + DateTime createdAt; + + int quoteId; + + bool upvote; + + /// Returns a shallow copy of this [Vote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Vote copyWith({ + int? id, + int? userId, + DateTime? createdAt, + int? quoteId, + bool? upvote, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'userId': userId, + 'createdAt': createdAt.toJson(), + 'quoteId': quoteId, + 'upvote': upvote, + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _VoteImpl extends Vote { + _VoteImpl({ + int? id, + required int userId, + required DateTime createdAt, + required int quoteId, + required bool upvote, + }) : super._( + id: id, + userId: userId, + createdAt: createdAt, + quoteId: quoteId, + upvote: upvote, + ); + + /// Returns a shallow copy of this [Vote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Vote copyWith({ + Object? id = _Undefined, + int? userId, + DateTime? createdAt, + int? quoteId, + bool? upvote, + }) { + return Vote( + id: id is int? ? id : this.id, + userId: userId ?? this.userId, + createdAt: createdAt ?? this.createdAt, + quoteId: quoteId ?? this.quoteId, + upvote: upvote ?? this.upvote, + ); + } +} diff --git a/wien_talks/wien_talks_client/lib/wien_talks_client.dart b/wien_talks/wien_talks_client/lib/wien_talks_client.dart new file mode 100644 index 0000000..d81f69b --- /dev/null +++ b/wien_talks/wien_talks_client/lib/wien_talks_client.dart @@ -0,0 +1,2 @@ +export 'src/protocol/protocol.dart'; +export 'package:serverpod_client/serverpod_client.dart'; diff --git a/wien_talks/wien_talks_client/pubspec.yaml b/wien_talks/wien_talks_client/pubspec.yaml new file mode 100644 index 0000000..453c07a --- /dev/null +++ b/wien_talks/wien_talks_client/pubspec.yaml @@ -0,0 +1,10 @@ +name: wien_talks_client +description: Starting point for a Serverpod client. + +environment: + sdk: '>=3.5.0 <4.0.0' + +dependencies: + + serverpod_client: 2.9.1 + serverpod_auth_server: ^2.9.1 diff --git a/wien_talks/.gitignore b/wien_talks/wien_talks_flutter/.gitignore similarity index 87% rename from wien_talks/.gitignore rename to wien_talks/wien_talks_flutter/.gitignore index 79c113f..734b7b3 100644 --- a/wien_talks/.gitignore +++ b/wien_talks/wien_talks_flutter/.gitignore @@ -5,12 +5,9 @@ *.swp .DS_Store .atom/ -.build/ .buildlog/ .history .svn/ -.swiftpm/ -migrate_working_dir/ # IntelliJ related *.iml @@ -29,11 +26,15 @@ migrate_working_dir/ .dart_tool/ .flutter-plugins .flutter-plugins-dependencies +.packages .pub-cache/ .pub/ /build/ -# Symbolication related +# Web related +lib/generated_plugin_registrant.dart + +# Symbolization related app.*.symbols # Obfuscation related @@ -43,3 +44,6 @@ app.*.map.json /android/app/debug /android/app/profile /android/app/release + + +.env \ No newline at end of file diff --git a/wien_talks/.metadata b/wien_talks/wien_talks_flutter/.metadata similarity index 100% rename from wien_talks/.metadata rename to wien_talks/wien_talks_flutter/.metadata diff --git a/wien_talks/wien_talks_flutter/README.md b/wien_talks/wien_talks_flutter/README.md new file mode 100644 index 0000000..4d25881 --- /dev/null +++ b/wien_talks/wien_talks_flutter/README.md @@ -0,0 +1,27 @@ +# wien_talks_flutter + +A new Flutter project with Serverpod. + +## Getting Started + +This project is a starting point for a Flutter application that is using +Serverpod. + +A great starting point for learning Serverpod is our documentation site at: +[https://docs.serverpod.dev](https://docs.serverpod.dev). + +To run the project, first make sure that the server is running, then do: + + flutter run + +## Flutter start: + +add environment variable in the Additional arguments field in Android Studio: + +--dart-define=SERVER_URL=http://localhost:5432/ + +Note: Host MUST end with a slash + +## docker start: + +wien_talks_server>docker compose -f docker-compose.local.yaml up -d \ No newline at end of file diff --git a/wien_talks/analysis_options.yaml b/wien_talks/wien_talks_flutter/analysis_options.yaml similarity index 93% rename from wien_talks/analysis_options.yaml rename to wien_talks/wien_talks_flutter/analysis_options.yaml index 0d29021..fd16f92 100644 --- a/wien_talks/analysis_options.yaml +++ b/wien_talks/wien_talks_flutter/analysis_options.yaml @@ -13,7 +13,8 @@ linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code @@ -23,6 +24,5 @@ linter: rules: # avoid_print: false # Uncomment to disable the `avoid_print` rule # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/wien_talks/android/.gitignore b/wien_talks/wien_talks_flutter/android/.gitignore similarity index 100% rename from wien_talks/android/.gitignore rename to wien_talks/wien_talks_flutter/android/.gitignore diff --git a/wien_talks/android/app/build.gradle.kts b/wien_talks/wien_talks_flutter/android/app/build.gradle.kts similarity index 93% rename from wien_talks/android/app/build.gradle.kts rename to wien_talks/wien_talks_flutter/android/app/build.gradle.kts index 5fcf9da..c8f71fe 100644 --- a/wien_talks/android/app/build.gradle.kts +++ b/wien_talks/wien_talks_flutter/android/app/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } android { - namespace = "com.example.wien_talks" + namespace = "com.wien_talks" compileSdk = flutter.compileSdkVersion ndkVersion = flutter.ndkVersion @@ -21,7 +21,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId = "com.example.wien_talks" + applicationId = "com.wien_talks" // You can update the following values to match your application needs. // For more information, see: https://flutter.dev/to/review-gradle-config. minSdk = flutter.minSdkVersion diff --git a/wien_talks/android/app/src/debug/AndroidManifest.xml b/wien_talks/wien_talks_flutter/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from wien_talks/android/app/src/debug/AndroidManifest.xml rename to wien_talks/wien_talks_flutter/android/app/src/debug/AndroidManifest.xml diff --git a/wien_talks/android/app/src/main/AndroidManifest.xml b/wien_talks/wien_talks_flutter/android/app/src/main/AndroidManifest.xml similarity index 91% rename from wien_talks/android/app/src/main/AndroidManifest.xml rename to wien_talks/wien_talks_flutter/android/app/src/main/AndroidManifest.xml index d468ac2..fd81ced 100644 --- a/wien_talks/android/app/src/main/AndroidManifest.xml +++ b/wien_talks/wien_talks_flutter/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + + + diff --git a/wien_talks/android/app/src/main/kotlin/com/example/wien_talks/MainActivity.kt b/wien_talks/wien_talks_flutter/android/app/src/main/kotlin/com/example/wien_talks_flutter/MainActivity.kt similarity index 75% rename from wien_talks/android/app/src/main/kotlin/com/example/wien_talks/MainActivity.kt rename to wien_talks/wien_talks_flutter/android/app/src/main/kotlin/com/example/wien_talks_flutter/MainActivity.kt index 649813b..e7875b1 100644 --- a/wien_talks/android/app/src/main/kotlin/com/example/wien_talks/MainActivity.kt +++ b/wien_talks/wien_talks_flutter/android/app/src/main/kotlin/com/example/wien_talks_flutter/MainActivity.kt @@ -1,4 +1,4 @@ -package com.example.wien_talks +package com.wien_talks import io.flutter.embedding.android.FlutterActivity diff --git a/wien_talks/android/app/src/main/res/drawable-v21/launch_background.xml b/wien_talks/wien_talks_flutter/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from wien_talks/android/app/src/main/res/drawable-v21/launch_background.xml rename to wien_talks/wien_talks_flutter/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/wien_talks/android/app/src/main/res/drawable/launch_background.xml b/wien_talks/wien_talks_flutter/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from wien_talks/android/app/src/main/res/drawable/launch_background.xml rename to wien_talks/wien_talks_flutter/android/app/src/main/res/drawable/launch_background.xml diff --git a/wien_talks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from wien_talks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/wien_talks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from wien_talks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/wien_talks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from wien_talks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/wien_talks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from wien_talks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/wien_talks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from wien_talks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to wien_talks/wien_talks_flutter/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/wien_talks/android/app/src/main/res/values-night/styles.xml b/wien_talks/wien_talks_flutter/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from wien_talks/android/app/src/main/res/values-night/styles.xml rename to wien_talks/wien_talks_flutter/android/app/src/main/res/values-night/styles.xml diff --git a/wien_talks/android/app/src/main/res/values/styles.xml b/wien_talks/wien_talks_flutter/android/app/src/main/res/values/styles.xml similarity index 100% rename from wien_talks/android/app/src/main/res/values/styles.xml rename to wien_talks/wien_talks_flutter/android/app/src/main/res/values/styles.xml diff --git a/wien_talks/android/app/src/profile/AndroidManifest.xml b/wien_talks/wien_talks_flutter/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from wien_talks/android/app/src/profile/AndroidManifest.xml rename to wien_talks/wien_talks_flutter/android/app/src/profile/AndroidManifest.xml diff --git a/wien_talks/android/build.gradle.kts b/wien_talks/wien_talks_flutter/android/build.gradle.kts similarity index 100% rename from wien_talks/android/build.gradle.kts rename to wien_talks/wien_talks_flutter/android/build.gradle.kts diff --git a/wien_talks/android/gradle.properties b/wien_talks/wien_talks_flutter/android/gradle.properties similarity index 100% rename from wien_talks/android/gradle.properties rename to wien_talks/wien_talks_flutter/android/gradle.properties diff --git a/wien_talks/android/gradle/wrapper/gradle-wrapper.properties b/wien_talks/wien_talks_flutter/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from wien_talks/android/gradle/wrapper/gradle-wrapper.properties rename to wien_talks/wien_talks_flutter/android/gradle/wrapper/gradle-wrapper.properties diff --git a/wien_talks/android/settings.gradle.kts b/wien_talks/wien_talks_flutter/android/settings.gradle.kts similarity index 100% rename from wien_talks/android/settings.gradle.kts rename to wien_talks/wien_talks_flutter/android/settings.gradle.kts diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/falco.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/falco.jpg new file mode 100644 index 0000000..e0d214f Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/falco.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/fiaker.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/fiaker.jpg new file mode 100644 index 0000000..e06813e Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/fiaker.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/houses.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/houses.jpg new file mode 100644 index 0000000..ab89968 Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/houses.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/kangaroos.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/kangaroos.jpg new file mode 100644 index 0000000..9418789 Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/kangaroos.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/sightseeing.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/sightseeing.jpg new file mode 100644 index 0000000..ff94183 Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/sightseeing.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/tram.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/tram.jpg new file mode 100644 index 0000000..e9c4d3c Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/tram.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/funny_images/wastebin.jpg b/wien_talks/wien_talks_flutter/assets/funny_images/wastebin.jpg new file mode 100644 index 0000000..96cdc27 Binary files /dev/null and b/wien_talks/wien_talks_flutter/assets/funny_images/wastebin.jpg differ diff --git a/wien_talks/wien_talks_flutter/assets/render_themes/defaultrender.xml b/wien_talks/wien_talks_flutter/assets/render_themes/defaultrender.xml new file mode 100644 index 0000000..a82424f --- /dev/null +++ b/wien_talks/wien_talks_flutter/assets/render_themes/defaultrender.xml @@ -0,0 +1,1507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wien_talks/wien_talks_flutter/devtools_options.yaml b/wien_talks/wien_talks_flutter/devtools_options.yaml new file mode 100644 index 0000000..fa0b357 --- /dev/null +++ b/wien_talks/wien_talks_flutter/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/wien_talks/ios/.gitignore b/wien_talks/wien_talks_flutter/ios/.gitignore similarity index 100% rename from wien_talks/ios/.gitignore rename to wien_talks/wien_talks_flutter/ios/.gitignore diff --git a/wien_talks/ios/Flutter/AppFrameworkInfo.plist b/wien_talks/wien_talks_flutter/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from wien_talks/ios/Flutter/AppFrameworkInfo.plist rename to wien_talks/wien_talks_flutter/ios/Flutter/AppFrameworkInfo.plist diff --git a/wien_talks/ios/Flutter/Debug.xcconfig b/wien_talks/wien_talks_flutter/ios/Flutter/Debug.xcconfig similarity index 100% rename from wien_talks/ios/Flutter/Debug.xcconfig rename to wien_talks/wien_talks_flutter/ios/Flutter/Debug.xcconfig diff --git a/wien_talks/ios/Flutter/Release.xcconfig b/wien_talks/wien_talks_flutter/ios/Flutter/Release.xcconfig similarity index 100% rename from wien_talks/ios/Flutter/Release.xcconfig rename to wien_talks/wien_talks_flutter/ios/Flutter/Release.xcconfig diff --git a/wien_talks/ios/Runner.xcodeproj/project.pbxproj b/wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.pbxproj similarity index 98% rename from wien_talks/ios/Runner.xcodeproj/project.pbxproj rename to wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.pbxproj index c2ead99..09f5c00 100644 --- a/wien_talks/ios/Runner.xcodeproj/project.pbxproj +++ b/wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.pbxproj @@ -368,7 +368,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -384,7 +384,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -401,7 +401,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -416,7 +416,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -547,7 +547,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -569,7 +569,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/wien_talks/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from wien_talks/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/wien_talks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from wien_talks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/wien_talks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from wien_talks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/wien_talks/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from wien_talks/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to wien_talks/wien_talks_flutter/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/wien_talks/ios/Runner.xcworkspace/contents.xcworkspacedata b/wien_talks/wien_talks_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from wien_talks/ios/Runner.xcworkspace/contents.xcworkspacedata rename to wien_talks/wien_talks_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/wien_talks/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/wien_talks/wien_talks_flutter/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from wien_talks/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to wien_talks/wien_talks_flutter/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/wien_talks/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/wien_talks/wien_talks_flutter/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from wien_talks/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to wien_talks/wien_talks_flutter/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/wien_talks/ios/Runner/AppDelegate.swift b/wien_talks/wien_talks_flutter/ios/Runner/AppDelegate.swift similarity index 100% rename from wien_talks/ios/Runner/AppDelegate.swift rename to wien_talks/wien_talks_flutter/ios/Runner/AppDelegate.swift diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from wien_talks/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to wien_talks/wien_talks_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/wien_talks/ios/Runner/Base.lproj/LaunchScreen.storyboard b/wien_talks/wien_talks_flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from wien_talks/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to wien_talks/wien_talks_flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/wien_talks/ios/Runner/Base.lproj/Main.storyboard b/wien_talks/wien_talks_flutter/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from wien_talks/ios/Runner/Base.lproj/Main.storyboard rename to wien_talks/wien_talks_flutter/ios/Runner/Base.lproj/Main.storyboard diff --git a/wien_talks/ios/Runner/Info.plist b/wien_talks/wien_talks_flutter/ios/Runner/Info.plist similarity index 95% rename from wien_talks/ios/Runner/Info.plist rename to wien_talks/wien_talks_flutter/ios/Runner/Info.plist index ccf4644..15cd975 100644 --- a/wien_talks/ios/Runner/Info.plist +++ b/wien_talks/wien_talks_flutter/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Wien Talks + Wien Talks Flutter CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - wien_talks + wien_talks_flutter CFBundlePackageType APPL CFBundleShortVersionString diff --git a/wien_talks/ios/Runner/Runner-Bridging-Header.h b/wien_talks/wien_talks_flutter/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from wien_talks/ios/Runner/Runner-Bridging-Header.h rename to wien_talks/wien_talks_flutter/ios/Runner/Runner-Bridging-Header.h diff --git a/wien_talks/ios/RunnerTests/RunnerTests.swift b/wien_talks/wien_talks_flutter/ios/RunnerTests/RunnerTests.swift similarity index 100% rename from wien_talks/ios/RunnerTests/RunnerTests.swift rename to wien_talks/wien_talks_flutter/ios/RunnerTests/RunnerTests.swift diff --git a/wien_talks/wien_talks_flutter/lib/helper/auth_service.dart b/wien_talks/wien_talks_flutter/lib/helper/auth_service.dart new file mode 100644 index 0000000..0445f78 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/helper/auth_service.dart @@ -0,0 +1,30 @@ +import 'package:google_sign_in/google_sign_in.dart'; + +class AuthService { + static final _google = GoogleSignIn.instance; + + static AuthService? _instance; + + AuthService._() { + _google.initialize(); + } + factory AuthService() { + if (_instance != null) return _instance!; + _instance = AuthService._(); + + return _instance!; + } + + static Stream get onUserChanged => + _google.authenticationEvents; + + static Future signIn() async { + try { + return await _google.authenticate(); + } catch (_) { + return null; + } + } + + static Future signOut() => _google.disconnect(); +} diff --git a/wien_talks/wien_talks_flutter/lib/helper/funmap_mgr.dart b/wien_talks/wien_talks_flutter/lib/helper/funmap_mgr.dart new file mode 100644 index 0000000..846e1ad --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/helper/funmap_mgr.dart @@ -0,0 +1,37 @@ +import 'package:serverpod_flutter/serverpod_flutter.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; + +class FunmapMgr { + static FunmapMgr? _instance; + + FunmapMgr._() { + configure(); + } + + late Client client; + + late final String serverUrl; + + factory FunmapMgr() { + if (_instance != null) return _instance!; + _instance = FunmapMgr._(); + return _instance!; + } + + void configure() { + // When you are running the app on a physical device, you need to set the + // server URL to the IP address of your computer. You can find the IP + // address by running `ipconfig` on Windows or `ifconfig` on Mac/Linux. + // You can set the variable when running or building your app like this: + // 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; + + client = Client(serverUrl, connectionTimeout: const Duration(seconds: 2)) + ..connectivityMonitor = FlutterConnectivityMonitor(); + + client.openStreamingConnection(); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/helper/go_router.dart b/wien_talks/wien_talks_flutter/lib/helper/go_router.dart new file mode 100644 index 0000000..679cd7e --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/helper/go_router.dart @@ -0,0 +1,15 @@ +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'; + +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()), + ], +); diff --git a/wien_talks/wien_talks_flutter/lib/helper/location_mgr.dart b/wien_talks/wien_talks_flutter/lib/helper/location_mgr.dart new file mode 100644 index 0000000..3dbcfb3 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/helper/location_mgr.dart @@ -0,0 +1,112 @@ +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:location/location.dart'; +import 'package:mapsforge_flutter/core.dart'; +import 'package:mapsforge_flutter/maps.dart'; +import 'package:mapsforge_flutter/marker.dart'; +import 'package:rxdart/rxdart.dart'; + +class LocationMgr { + final Location location = Location(); + + bool serviceEnabled = false; + + PermissionStatus permissionGranted = PermissionStatus.denied; + + LocationData? _lastLocationData; + + static LocationMgr? _instance; + + final Subject _subject = PublishSubject(); + + final TileBitmapCache bitmapCache = MemoryTileBitmapCache.create(); + + StreamSubscription? _subscription; + + ViewModel? viewModel; + + MapModel? mapModel; + + IconMarker? iconMarker; + + final DisplayModel displayModel = DisplayModel(maxZoomLevel: 18); + + final SymbolCache symbolCache = FileSymbolCache(); + + final JobRenderer jobRenderer = + kIsWeb ? MapOnlineRendererWeb() : MapOnlineRenderer(); + + final MarkerByItemDataStore markerDataStore = MarkerByItemDataStore(); + + factory LocationMgr() { + _instance ??= LocationMgr._(); + return _instance!; + } + + LocationMgr._(); + + Future startup() async { + serviceEnabled = await location.serviceEnabled(); + if (!serviceEnabled) { + serviceEnabled = await location.requestService(); + if (!serviceEnabled) { + return "Service is not enabled"; + } + } + + permissionGranted = await location.hasPermission(); + if (permissionGranted == PermissionStatus.denied) { + permissionGranted = await location.requestPermission(); + if (permissionGranted != PermissionStatus.granted) { + return "No permissions granted"; + } + } + mapModel = MapModel( + displayModel: displayModel, + renderer: jobRenderer, + symbolCache: symbolCache, + tileBitmapCache: bitmapCache, + ); + mapModel?.markerDataStores.add(markerDataStore); + viewModel = ViewModel(displayModel: displayModel); + _subscription = + location.onLocationChanged.listen((LocationData currentLocation) { + _lastLocationData = currentLocation; + 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!), + displayModel: displayModel); + mapModel?.markerDataStores + .add(MarkerDataStore()..addMarker(iconMarker!)); + } + } + _subject.add(currentLocation); + }); + return null; + } + + void shutdown() { + _subscription?.cancel(); + _subscription = null; + mapModel?.dispose(); + mapModel = null; + iconMarker = null; + viewModel?.dispose(); + viewModel = null; + _lastLocationData = null; + } + + Stream get stream => _subject.stream; + + LocationData? get lastLocation => _lastLocationData; +} diff --git a/wien_talks/wien_talks_flutter/lib/helper/location_util.dart b/wien_talks/wien_talks_flutter/lib/helper/location_util.dart new file mode 100644 index 0000000..22b390f --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/helper/location_util.dart @@ -0,0 +1,29 @@ +import 'package:flutter_dotenv/flutter_dotenv.dart'; + +String gStaticMap( + double lat, + double lon, { + int w = 600, + int h = 360, + int zoom = 15, + int scale = 2, + String markerHex = 'E53935', + String maptype = 'roadmap', + String language = 'de', + String region = 'AT', +}) { + final mapsApiKey = dotenv.env['MAPS_KEY'] ?? ''; + final qp = { + 'center': '$lat,$lon', + 'zoom': '$zoom', + 'size': '${w}x$h', + 'scale': '$scale', + 'maptype': maptype, + 'format': 'png', + 'language': language, + 'region': region, + 'markers': 'color:0x$markerHex|$lat,$lon', + 'key': mapsApiKey, + }; + return Uri.https('maps.googleapis.com', '/maps/api/staticmap', qp).toString(); +} diff --git a/wien_talks/wien_talks_flutter/lib/helper/time_util.dart b/wien_talks/wien_talks_flutter/lib/helper/time_util.dart new file mode 100644 index 0000000..e7e8c68 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/helper/time_util.dart @@ -0,0 +1,17 @@ +// Clanker code, I caved +String timeAgo(DateTime? dt) { + final d = + (dt ?? DateTime.fromMillisecondsSinceEpoch(0, isUtc: true)).toLocal(); + final now = DateTime.now(); + final diff = now.isBefore(d) ? Duration.zero : now.difference(d); + + return switch (diff.inSeconds) { + < 60 => 'just now', + < 3600 => '${diff.inMinutes}m ago', + < 86400 => '${diff.inHours}h ago', + < 604800 => '${diff.inDays}d ago', + _ => '${d.year.toString().padLeft(4, '0')}-' + '${d.month.toString().padLeft(2, '0')}-' + '${d.day.toString().padLeft(2, '0')}', + }; +} diff --git a/wien_talks/wien_talks_flutter/lib/main.dart b/wien_talks/wien_talks_flutter/lib/main.dart new file mode 100644 index 0000000..1f585ca --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/main.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_dotenv/flutter_dotenv.dart'; +import 'package:wien_talks_flutter/helper/go_router.dart'; + +Future main() async { + await dotenv.load(fileName: '.env'); + runApp(const MyApp()); +} + +class MyApp extends StatelessWidget { + const MyApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp.router( + title: 'Wien Talks', + theme: ThemeData(primarySwatch: Colors.green), + routerConfig: router, + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/mapfile_widget.dart b/wien_talks/wien_talks_flutter/lib/mapfile_widget.dart new file mode 100644 index 0000000..c8c1958 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/mapfile_widget.dart @@ -0,0 +1,26 @@ +import 'package:flutter/cupertino.dart'; +import 'package:mapsforge_flutter/core.dart'; +import 'package:wien_talks_flutter/helper/location_mgr.dart'; + +class MapfileWidget extends StatefulWidget { + const MapfileWidget({super.key}); + + @override + State createState() => _MapfileWidgetState(); +} + +////////////////////////////////////////////////////////////////////////////// + +class _MapfileWidgetState extends State { + @override + Widget build(BuildContext context) { + return MapviewWidget( + displayModel: LocationMgr().displayModel, + createMapModel: () async { + return LocationMgr().mapModel!; + }, + createViewModel: () async { + return LocationMgr().viewModel!; + }); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/models/news_event_model.dart b/wien_talks/wien_talks_flutter/lib/models/news_event_model.dart new file mode 100644 index 0000000..d1fce39 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/models/news_event_model.dart @@ -0,0 +1,34 @@ +class NewsEventModel { + final String content; + + final DateTime timestamp; + + final double latitude; + + final double longitude; + + NewsEventModel({ + required this.content, + required this.timestamp, + required this.latitude, + required this.longitude, + }); + +// Convert NewsData to a Map + Map toJson() { + return { + 'content': content, + 'timestamp': timestamp.toIso8601String(), + }; + } + +// Create NewsData from a Map + factory NewsEventModel.fromJson(Map json) { + return NewsEventModel( + content: json['content'] as String, + timestamp: DateTime.parse(json['timestamp'] as String), + latitude: json['latitude'] as double, + longitude: json['longitude'] as double, + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/screens/create_event_screen.dart b/wien_talks/wien_talks_flutter/lib/screens/create_event_screen.dart new file mode 100644 index 0000000..d31166f --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/screens/create_event_screen.dart @@ -0,0 +1,40 @@ +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/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/widgets/screen_widget.dart'; + +import '../helper/location_mgr.dart'; + +class CreateEventScreen extends StatelessWidget { + const CreateEventScreen({super.key}); + + @override + Widget build(BuildContext context) { + return ScreenWidget( + child: Column( + children: [ + NewsInputForm( + onSubmit: (CreateQuoteRequest request) async { + await FunmapMgr().client.quote.createQuote(request); + }, + ), + StreamBuilder( + stream: LocationMgr().stream, + builder: + (BuildContext context, AsyncSnapshot snapshot) => + snapshot.data != null + ? Text(snapshot.data.toString()) + : SizedBox()), + Expanded( + child: GetLocationWidget( + child: MapfileWidget(), + ), + ), + ], + )); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/screens/home_screen.dart b/wien_talks/wien_talks_flutter/lib/screens/home_screen.dart new file mode 100644 index 0000000..7b56d8d --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/screens/home_screen.dart @@ -0,0 +1,59 @@ +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/widgets/intro_text_widget.dart'; +import 'package:wien_talks_flutter/widgets/screen_widget.dart'; + +import '../widgets/carousel_widget.dart'; + +class HomeScreen extends StatelessWidget { + const HomeScreen({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return ScreenWidget( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + IntroTextWidget(), + SizedBox(height: 200, child: LatestQuotesScreen()), + SizedBox( + height: 30, + ), + Row( + children: [ + Expanded( + child: ElevatedButton( + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all( + Theme.of(context).primaryColor), + foregroundColor: WidgetStateProperty.all( + Theme.of(context).colorScheme.onPrimary)), + onPressed: () { + context.pushNamed("create_event"); + }, + child: Text("Submit your own event")), + ), + ], + ), + SizedBox( + height: 30, + ), + CarouselWidget(), + Row( + children: [ + Spacer(), + Text(FunmapMgr().serverUrl, + style: Theme.of(context).textTheme.bodySmall), + ], + ) + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/screens/login_page.dart b/wien_talks/wien_talks_flutter/lib/screens/login_page.dart new file mode 100644 index 0000000..1eff639 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/screens/login_page.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:wien_talks_flutter/helper/auth_service.dart'; + +class LoginScreen extends StatelessWidget { + const LoginScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [Color(0xff2193b0), Color(0xff6dd5ed)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + alignment: Alignment.center, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('Wien Talks', + style: GoogleFonts.poppins( + fontSize: 42, + fontWeight: FontWeight.bold, + color: Colors.white)), + const SizedBox(height: 60), + FilledButton.icon( + onPressed: () async => await AuthService.signIn(), + style: FilledButton.styleFrom( + backgroundColor: Colors.white, + foregroundColor: Colors.black87, + padding: + const EdgeInsets.symmetric(horizontal: 24, vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30)), + elevation: 6, + ), + icon: Icon( + Icons.lock, + ), + label: const Text('Sign in with Google'), + ), + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/screens/news_screen.dart b/wien_talks/wien_talks_flutter/lib/screens/news_screen.dart new file mode 100644 index 0000000..79d2c14 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/screens/news_screen.dart @@ -0,0 +1,33 @@ +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/widgets/heading_text.dart'; +import 'package:wien_talks_flutter/widgets/screen_widget.dart'; + +class NewsScreen extends StatelessWidget { + const NewsScreen({ + super.key, + }); + + @override + Widget build(BuildContext context) { + var column = Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + HeadingText(text: "What's being said"), + LatestQuotesScreen(), + SizedBox( + height: 30, + ), + ElevatedButton( + onPressed: () { + context.pushNamed("create_event"); + }, + child: Text("Submit your own event")), + ], + ); + return ScreenWidget( + child: LatestQuotesScreen(), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/screens/show_latest_news_widget.dart b/wien_talks/wien_talks_flutter/lib/screens/show_latest_news_widget.dart new file mode 100644 index 0000000..062b24b --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/screens/show_latest_news_widget.dart @@ -0,0 +1,132 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; +import 'package:wien_talks_flutter/helper/funmap_mgr.dart'; +import 'package:wien_talks_flutter/helper/location_util.dart'; +import 'package:wien_talks_flutter/helper/time_util.dart'; +import 'package:wien_talks_flutter/widgets/flamboyant_quote_card.dart'; + +class LatestQuotesScreen extends StatefulWidget { + const LatestQuotesScreen({super.key}); + + @override + State createState() => _LatestQuotesScreenState(); +} + +class _LatestQuotesScreenState extends State { + final List _quotes = []; + StreamSubscription? _sub; + + Object? _error; + + @override + void initState() { + super.initState(); + _connectStream(); + } + + @override + void dispose() { + _sub?.cancel(); + super.dispose(); + } + + void _connectStream() { + _sub?.cancel(); + _sub = FunmapMgr().client.quote.streamAllQuotes(limit: 50).listen( + (q) => setState(() => _upsert(q)), + onError: (e) => setState(() => _error = e), + onDone: () => Future.delayed(const Duration(seconds: 2), () { + if (mounted) _connectStream(); + }), + cancelOnError: false, + ); + } + + void _upsert(Quote q) { + final i = _quotes.indexWhere((x) => x.id == q.id); + if (i >= 0) { + _quotes[i] = q; + } else { + _quotes.add(q); + } + _quotes.sort((a, b) => b.createdAt.compareTo(a.createdAt)); + } + + void _sortDesc() { + _quotes.sort((a, b) => b.createdAt.compareTo(a.createdAt)); + } + + Future _vote(Quote quote, bool up) async { + 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(() { + _quotes[idx] = updated; + _sortDesc(); + }); + + try { + await FunmapMgr().client.quote.updateQuote(updated); + } catch (e) { + if (!mounted) return; + setState(() => _quotes[idx] = original); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Vote failed: $e')), + ); + } + } + + @override + Widget build(BuildContext context) { + if (_quotes.isEmpty && _error == null) { + return const Center(child: CircularProgressIndicator()); + } + if (_error != null && _quotes.isEmpty) { + return Center( + child: Padding( + padding: const EdgeInsets.all(16), + child: Text('Error: $_error'), + ), + ); + } + if (_quotes.isEmpty) { + return const Center(child: Text('Nix da. Sag halt was')); + } + + return LayoutBuilder( + builder: (context, constraints) { + return MasonryGridView.count( + crossAxisCount: 2, + mainAxisSpacing: 8, + crossAxisSpacing: 8, + padding: const EdgeInsets.fromLTRB(12, 8, 12, 12), + itemCount: _quotes.length, + itemBuilder: (context, i) { + final q = _quotes[i]; + final author = (q.authorName ?? '').trim(); + final meta = [ + if (author.isNotEmpty) author, + timeAgo(q.createdAt), + ].join(' · '); + + return FlamboyantQuoteCard( + quote: q, + meta: meta, + onVoteUp: () => _vote(q, true), + onVoteDown: () => _vote(q, false), + staticMapUrlBuilder: gStaticMap); + }, + ); + }, + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/add_quote_fab.dart b/wien_talks/wien_talks_flutter/lib/widgets/add_quote_fab.dart new file mode 100644 index 0000000..848344f --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/add_quote_fab.dart @@ -0,0 +1,199 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:location/location.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; +import 'package:wien_talks_flutter/helper/funmap_mgr.dart'; + +class QuoteDraft { + final String text; + final String? author; + const QuoteDraft({required this.text, this.author}); +} + +typedef QuoteSubmit = FutureOr Function(QuoteDraft draft); + +/// If Simon reads this I'm sorry +class AddQuoteFab extends StatelessWidget { + const AddQuoteFab({ + super.key, + this.tooltip = 'Add quote', + this.icon = Icons.format_quote_rounded, + this.mini = false, + }); + + final String tooltip; + final IconData icon; + final bool mini; + + Future onSubmit(QuoteDraft draft) async { + final fix = await _getHackyLocation(); + if (fix == null || fix.latitude == null) { + return; + } + + await FunmapMgr().client.quote.createQuote( + CreateQuoteRequest( + text: draft.text, + authorName: draft.author, + lat: fix.latitude!, + lng: fix.longitude!, + ), + ); + } + + Future _getHackyLocation() async { + final loc = Location(); + + if (!await loc.serviceEnabled()) { + if (!await loc.requestService()) return null; + } + + var perm = await loc.hasPermission(); + if (perm == PermissionStatus.denied) { + perm = await loc.requestPermission(); + if (perm != PermissionStatus.granted) return null; + } + + return await loc.getLocation(); + } + + @override + Widget build(BuildContext context) { + return FloatingActionButton( + mini: mini, + tooltip: tooltip, + onPressed: () async { + final draft = await showQuoteEditor(context); + if (draft != null) { + await onSubmit(draft); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Quote saved')), + ); + } + } + }, + child: Icon(icon), + ); + } +} + +Future showQuoteEditor( + BuildContext context, { + String? initialText, + String? initialAuthor, +}) async { + final textCtrl = TextEditingController(text: initialText ?? ''); + final authorCtrl = TextEditingController(text: initialAuthor ?? ''); + const maxChars = 500; + + return showModalBottomSheet( + context: context, + isScrollControlled: true, + useSafeArea: true, + showDragHandle: true, + builder: (ctx) { + bool canSave() { + final t = textCtrl.text.trim(); + return t.isNotEmpty && t.length <= maxChars; + } + + return Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(ctx).viewInsets.bottom, + ), + child: StatefulBuilder( + builder: (ctx, setSheetState) { + void onChanged(_) => setSheetState(() {}); + final remaining = maxChars - textCtrl.text.characters.length; + + return SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(16, 8, 16, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + Text('New quote', style: Theme.of(ctx).textTheme.titleMedium), + const SizedBox(height: 8), + TextField( + controller: textCtrl, + onChanged: onChanged, + autofocus: true, + maxLines: null, + minLines: 3, + textInputAction: TextInputAction.newline, + decoration: InputDecoration( + labelText: 'Vienna`s finest', + hintText: 'How is Vienna surprising you today', + helperText: 'Max $maxChars characters', + counterText: + '${textCtrl.text.characters.length}/$maxChars', + border: const OutlineInputBorder(), + ), + maxLength: maxChars, + maxLengthEnforcement: MaxLengthEnforcement.enforced, + ), + const SizedBox(height: 12), + TextField( + controller: authorCtrl, + textInputAction: TextInputAction.done, + decoration: const InputDecoration( + labelText: 'Author (optional)', + hintText: 'e.g., Schmausi Wamperl', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 12), + Row( + children: [ + Expanded( + child: OutlinedButton( + onPressed: () => Navigator.of(ctx).pop(null), + child: const Text('Cancel'), + ), + ), + const SizedBox(width: 12), + Expanded( + child: FilledButton.icon( + onPressed: canSave() + ? () => Navigator.of(ctx).pop( + QuoteDraft( + text: textCtrl.text.trim(), + author: authorCtrl.text.trim().isEmpty + ? null + : authorCtrl.text.trim(), + ), + ) + : null, + icon: const Icon(Icons.check), + label: const Text('Save'), + ), + ), + ], + ), + const SizedBox(height: 8), + Align( + alignment: Alignment.centerRight, + child: Text( + remaining >= 0 + ? '$remaining characters left' + : '${-remaining} over limit', + style: Theme.of(ctx).textTheme.labelSmall?.copyWith( + color: Theme.of(ctx) + .colorScheme + .onSurface + .withValues(alpha: 0.7), + ), + ), + ), + ], + ), + ); + }, + ), + ); + }, + ); +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/card_contenty.dart b/wien_talks/wien_talks_flutter/lib/widgets/card_contenty.dart new file mode 100644 index 0000000..2e8e211 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/card_contenty.dart @@ -0,0 +1,224 @@ +import 'package:flutter/material.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; +import 'package:wien_talks_flutter/widgets/flamboyant_quote_card.dart'; +import 'package:wien_talks_flutter/widgets/map_preview_widget.dart'; + +class CardContenty extends StatelessWidget { + const CardContenty({ + super.key, + required this.quote, + required this.staticMapUrlBuilder, + required this.meta, + required this.onVoteUp, + required this.onVoteDown, + required this.context, + required this.variant, + required this.accent, + required this.metaStyle, + }); + + final Quote quote; + final StaticMapUrlBuilder? staticMapUrlBuilder; + final String meta; + final VoidCallback onVoteUp; + final VoidCallback onVoteDown; + final BuildContext context; + final int variant; + final Color accent; + final TextStyle? metaStyle; + + @override + Widget build(BuildContext context) { + final hasMap = (variant != 0); + final map = hasMap + ? Padding( + padding: const EdgeInsets.only(bottom: 8), + child: MapPreview( + lat: quote.lat, + lon: quote.long, + accent: accent, + staticMapUrlBuilder: staticMapUrlBuilder, + ), + ) + : const SizedBox.shrink(); + + final textBlock = _ContentText( + quote: quote, + meta: meta, + metaStyle: metaStyle, + onVoteUp: onVoteUp, + onVoteDown: onVoteDown, + accent: accent); + + stacked() => Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [map, textBlock], + ); + + return switch (variant) { + 1 when hasMap => stacked(), + 2 when hasMap => LayoutBuilder( + builder: (context, c) { + final wide = c.maxWidth >= 420; + return wide + ? Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Flexible( + flex: 5, + child: Padding( + padding: const EdgeInsets.fromLTRB(12, 10, 8, 12), + child: MapPreview( + lat: quote.lat, + lon: quote.long, + accent: accent, + staticMapUrlBuilder: staticMapUrlBuilder, + aspect: 4 / 3, + ), + ), + ), + Flexible(flex: 7, child: textBlock), + ], + ) + : stacked(); + }, + ), + _ => textBlock, + }; + } +} + +class _ContentText extends StatelessWidget { + const _ContentText({ + required this.quote, + required this.meta, + required this.metaStyle, + required this.onVoteUp, + required this.onVoteDown, + required this.accent, + }); + + final Quote quote; + final String meta; + final TextStyle? metaStyle; + final VoidCallback onVoteUp; + final VoidCallback onVoteDown; + final Color accent; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.fromLTRB(12, 10, 12, 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + quote.text, + style: Theme.of(context).textTheme.bodyLarge, + ), + const SizedBox(height: 8), + Row( + children: [ + Expanded( + child: Text(meta, + style: metaStyle, overflow: TextOverflow.ellipsis)), + const SizedBox(width: 8), + _VotePills( + up: quote.upvotes, + down: quote.downvotes, + onUp: onVoteUp, + onDown: onVoteDown, + accent: accent, + ), + ], + ), + ], + ), + ); + } +} + +class _VotePills extends StatelessWidget { + const _VotePills({ + required this.up, + required this.down, + required this.onUp, + required this.onDown, + required this.accent, + }); + + final int up; + final int down; + final VoidCallback onUp; + final VoidCallback onDown; + final Color accent; + + @override + Widget build(BuildContext context) { + final t = Theme.of(context); + final bg = t.colorScheme.surfaceContainerHighest.withValues(alpha: 0.55); + final onBg = ThemeData.estimateBrightnessForColor(bg) == Brightness.dark + ? Colors.white + : const Color(0xFF1A1A1A); + final pillStyle = t.textTheme.labelSmall?.copyWith(color: onBg); + + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + _Pill( + icon: Icons.arrow_upward, + color: accent, + text: '$up', + onTap: onUp, + textStyle: pillStyle, + ), + const SizedBox(width: 6), + _Pill( + icon: Icons.arrow_downward, + color: const Color(0xFFD32F2F), + text: '$down', + onTap: onDown, + textStyle: pillStyle, + ), + ], + ); + } +} + +class _Pill extends StatelessWidget { + const _Pill({ + required this.icon, + required this.color, + required this.text, + required this.onTap, + required this.textStyle, + }); + + final IconData icon; + final Color color; + final String text; + final VoidCallback onTap; + final TextStyle? textStyle; + + @override + Widget build(BuildContext context) { + return Material( + color: color.withValues(alpha: 0.12), + borderRadius: BorderRadius.circular(999), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(999), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6), + child: Row( + children: [ + Icon(icon, size: 16, color: color), + const SizedBox(width: 6), + Text(text, style: textStyle), + ], + ), + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/carousel_widget.dart b/wien_talks/wien_talks_flutter/lib/widgets/carousel_widget.dart new file mode 100644 index 0000000..087b75d --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/carousel_widget.dart @@ -0,0 +1,26 @@ +import 'package:carousel_slider/carousel_slider.dart'; +import 'package:flutter/material.dart'; + +class CarouselWidget extends StatelessWidget { + const CarouselWidget({super.key}); + + @override + Widget build(BuildContext context) { + return IgnorePointer( + child: CarouselSlider( + options: CarouselOptions(height: 300.0, autoPlay: true), + items: ["houses.jpg", "kangaroos.jpg", "sightseeing.jpg", "tram.jpg", "fiaker.jpg", "falco.jpg", "wastebin.jpg"].map((i) { + return Builder( + builder: (BuildContext context) { + return Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.symmetric(horizontal: 5.0), + //decoration: BoxDecoration(color: Colors.amber), + child: Image(image: AssetImage("assets/funny_images/$i"))); + }, + ); + }).toList(), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/error_snackbar.dart b/wien_talks/wien_talks_flutter/lib/widgets/error_snackbar.dart new file mode 100644 index 0000000..d527a95 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/error_snackbar.dart @@ -0,0 +1,16 @@ +import 'package:flutter/material.dart'; + +class ErrorSnackbar { + void show(BuildContext context, String message) { + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text( + message, + style: TextStyle(color: Theme.of(context).colorScheme.onError), + maxLines: 3, + ), + showCloseIcon: true, + duration: Duration(seconds: 30), + backgroundColor: Theme.of(context).colorScheme.error, + )); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/flamboyant_quote_card.dart b/wien_talks/wien_talks_flutter/lib/widgets/flamboyant_quote_card.dart new file mode 100644 index 0000000..5ac0f3b --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/flamboyant_quote_card.dart @@ -0,0 +1,101 @@ +import 'dart:math' as math; + +import 'package:flutter/material.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; +import 'package:wien_talks_flutter/widgets/card_contenty.dart'; +import 'package:wien_talks_flutter/widgets/ubahn_tape.dart'; + +typedef StaticMapUrlBuilder = String Function( + double lat, + double lon, { + int w, + int h, + int zoom, +}); + +class FlamboyantQuoteCard extends StatelessWidget { + const FlamboyantQuoteCard({ + super.key, + required this.quote, + required this.meta, + required this.onVoteUp, + required this.onVoteDown, + this.staticMapUrlBuilder, + }); + + final Quote quote; + final String meta; + final VoidCallback onVoteUp; + final VoidCallback onVoteDown; + final StaticMapUrlBuilder? staticMapUrlBuilder; + + @override + Widget build(BuildContext context) { + final seed = (quote.id ?? quote.text.hashCode) & 0x7fffffff; + final rng = math.Random(seed); + + final variant = (rng.nextInt(3)); + + // Subtle tilt and accent + final tiltDeg = [-2.2, -1.4, -0.6, 0, 0.6, 1.2, 2.0][rng.nextInt(7)]; + final tiltRad = tiltDeg * math.pi / 180.0; + final accents = [ + const Color(0xFFE53935), // red + const Color(0xFF3949AB), // indigo + const Color(0xFF00897B), // teal + ]; + final accent = accents[seed % accents.length]; + + final t = Theme.of(context); + final metaStyle = t.textTheme.bodySmall?.copyWith( + color: (t.textTheme.bodySmall?.color ?? t.colorScheme.onSurface) + .withValues(alpha: 0.70), + ); + + final card = Container( + decoration: BoxDecoration( + color: t.colorScheme.surface, + borderRadius: BorderRadius.circular(14), + boxShadow: const [ + BoxShadow( + color: Color(0x14000000), + blurRadius: 12, + offset: Offset(0, 6), + ), + ], + border: Border.all(color: accent.withValues(alpha: 0.25), width: 1), + ), + child: CardContenty( + quote: quote, + staticMapUrlBuilder: staticMapUrlBuilder, + meta: meta, + onVoteUp: onVoteUp, + onVoteDown: onVoteDown, + context: context, + variant: variant, + accent: accent, + metaStyle: metaStyle), + ); + + return Padding( + padding: const EdgeInsets.only(top: 6, bottom: 2), + child: Stack( + clipBehavior: Clip.none, + children: [ + Transform.rotate( + angle: tiltRad, + child: card, + ), + Positioned( + top: -8, + right: 16, + child: UbahnTape( + lat: quote.lat, + lon: quote.long, + ), + ), + ], + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/get_location_widget.dart b/wien_talks/wien_talks_flutter/lib/widgets/get_location_widget.dart new file mode 100644 index 0000000..c7d738d --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/get_location_widget.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:wien_talks_flutter/helper/location_mgr.dart'; + +class GetLocationWidget extends StatefulWidget { + final Widget child; + + const GetLocationWidget({super.key, required this.child}); + + @override + State createState() => _GetLocationWidgetState(); +} + +class _GetLocationWidgetState extends State { + @override + void dispose() { + LocationMgr().shutdown(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: LocationMgr().startup(), + builder: (BuildContext context, AsyncSnapshot snapshot) { + switch (snapshot.connectionState) { + case ConnectionState.none: + case ConnectionState.waiting: + return Center(child: CircularProgressIndicator()); + case ConnectionState.active: + case ConnectionState.done: + { + if (snapshot.hasData) { + // Error occured + return Text(snapshot.data.toString(), + style: TextStyle(color: Colors.red)); + } else { + return widget.child; + } + } + } + }); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/heading_text.dart b/wien_talks/wien_talks_flutter/lib/widgets/heading_text.dart new file mode 100644 index 0000000..9aeb9f8 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/heading_text.dart @@ -0,0 +1,18 @@ +import 'package:flutter/material.dart'; + +class HeadingText extends StatelessWidget { + final String text; + + const HeadingText({super.key, required this.text}); + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 20, bottom: 10), + child: Text( + text, + style: Theme.of(context).textTheme.headlineLarge, + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/intro_text_widget.dart b/wien_talks/wien_talks_flutter/lib/widgets/intro_text_widget.dart new file mode 100644 index 0000000..4ed73d1 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/intro_text_widget.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +class IntroTextWidget extends StatelessWidget { + const IntroTextWidget({super.key}); + + @override + Widget build(BuildContext context) { + return Card( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Welcome to FunMap!", + style: GoogleFonts.poppins( + fontSize: 26, + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryColor, + ), + ), + const SizedBox(height: 20), + Text( + "Ever experienced something funny, weird, or just too good not to share? " + "With FunMap, you can pin your funniest moments and strange encounters right on the map! 😂", + style: GoogleFonts.roboto(fontSize: 16, height: 1.5), + ), + const SizedBox(height: 16), + Text( + "Share hilarious events from your daily life, discover what others nearby have spotted, " + "and explore a world full of smiles and surprises. Whether it’s a quirky street performer, " + "an awkward sign, or a random act of comedy — every little story has its place here.", + style: GoogleFonts.roboto(fontSize: 16, height: 1.5), + ), + const SizedBox(height: 16), + Text( + "👉 Add your event, mark the spot, and let the community enjoy the laughter with you.", + style: GoogleFonts.roboto( + fontSize: 16, + fontStyle: FontStyle.italic, + height: 1.5, + ), + ), + const SizedBox(height: 16), + Text( + "Because the world’s a lot more fun when we laugh together.", + style: GoogleFonts.roboto( + fontSize: 16, + fontWeight: FontWeight.w600, + height: 1.5, + ), + ), + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/map_preview_widget.dart b/wien_talks/wien_talks_flutter/lib/widgets/map_preview_widget.dart new file mode 100644 index 0000000..f6f5117 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/map_preview_widget.dart @@ -0,0 +1,92 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:wien_talks_flutter/widgets/flamboyant_quote_card.dart'; + +class MapPreview extends StatelessWidget { + const MapPreview({ + super.key, + required this.lat, + required this.lon, + required this.accent, + this.staticMapUrlBuilder, + this.aspect = 16 / 9, + }); + + final double lat; + final double lon; + final double aspect; + final Color accent; + final StaticMapUrlBuilder? staticMapUrlBuilder; + + @override + Widget build(BuildContext context) { + final border = Border.all(color: accent.withValues(alpha: 0.25), width: 1); + final r = BorderRadius.circular(12); + + final urlBuilder = staticMapUrlBuilder; + final w = + (MediaQuery.of(context).size.width / 2).clamp(280.0, 600.0).toInt(); + final h = (w / aspect).round(); + + Widget content; + if (urlBuilder != null) { + final url = urlBuilder(lat, lon, w: w, h: h, zoom: 15); + + content = ClipRRect( + borderRadius: r, + child: CachedNetworkImage( + imageUrl: url, + width: double.infinity, + height: h.toDouble(), + fit: BoxFit.cover, + ), + ); + } else { + content = + _MapPlaceholder(accent: accent, height: h.toDouble(), radius: r); + } + + return DecoratedBox( + decoration: BoxDecoration(border: border, borderRadius: r), + child: content, + ); + } +} + +class _MapPlaceholder extends StatelessWidget { + const _MapPlaceholder({required this.accent, this.height, this.radius}); + + final Color accent; + final double? height; + final BorderRadius? radius; + + @override + Widget build(BuildContext context) { + final t = Theme.of(context); + return ClipRRect( + borderRadius: radius ?? BorderRadius.circular(12), + child: Container( + height: height, + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + t.colorScheme.surfaceContainerHighest.withValues(alpha: 0.50), + t.colorScheme.surfaceContainerHighest.withValues(alpha: 0.20), + ], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.location_on, color: accent), + const SizedBox(width: 8), + Text('Map preview', style: t.textTheme.labelMedium), + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/news_input_form.dart b/wien_talks/wien_talks_flutter/lib/widgets/news_input_form.dart new file mode 100644 index 0000000..56b9bdb --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/news_input_form.dart @@ -0,0 +1,98 @@ +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/widgets/error_snackbar.dart'; + +typedef OnSubmit = Future Function(CreateQuoteRequest request); + +class NewsInputForm extends StatefulWidget { + final OnSubmit onSubmit; + + const NewsInputForm({super.key, required this.onSubmit}); + + @override + // ignore: library_private_types_in_public_api + _NewsInputFormState createState() => _NewsInputFormState(); +} + +class _NewsInputFormState extends State { + final _formKey = GlobalKey(); + final TextEditingController _newsController = TextEditingController(); + + @override + void dispose() { + _newsController.dispose(); + super.dispose(); + } + + 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"); + return; + } + if (_formKey.currentState!.validate()) { + final newsData = CreateQuoteRequest( + text: _newsController.text.trim(), + lat: LocationMgr().lastLocation!.latitude!, + lng: LocationMgr().lastLocation!.longitude!, + ); + var handler = context.loaderOverlay..show(); + try { + await widget.onSubmit(newsData); + } catch (error) { + if (mounted) { + ErrorSnackbar().show(context, error.toString()); + } + } finally { + handler.hide(); + } + } + } + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.all(16.0), + child: Form( + key: _formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + TextFormField( + controller: _newsController, + maxLines: 4, + decoration: const InputDecoration( + labelText: 'News', + hintText: 'Enter your news here...', + border: OutlineInputBorder(), + ), + validator: (value) { + if (value == null || value.trim().isEmpty) { + return 'Please enter some text'; + } + return null; + }, + ), + const SizedBox(height: 16.0), + ElevatedButton( + style: ButtonStyle( + backgroundColor: + WidgetStateProperty.all(Theme.of(context).primaryColor), + foregroundColor: WidgetStateProperty.all( + Theme.of(context).colorScheme.onPrimary)), + onPressed: _submitForm, + child: const Text('Submit News'), + ), + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/quote_card.dart b/wien_talks/wien_talks_flutter/lib/widgets/quote_card.dart new file mode 100644 index 0000000..65f3832 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/quote_card.dart @@ -0,0 +1,121 @@ +import 'package:flutter/material.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; +import 'package:wien_talks_flutter/widgets/vote_button.dart'; + +class QuoteCard extends StatefulWidget { + const QuoteCard({ + super.key, + required this.quote, + required this.meta, + required this.onVoteUp, + required this.onVoteDown, + }); + + final Quote quote; + final String meta; + final VoidCallback onVoteUp; + final VoidCallback onVoteDown; + + @override + State createState() => _QuoteCardState(); +} + +class _QuoteCardState extends State { + 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, + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/rail_divider.dart b/wien_talks/wien_talks_flutter/lib/widgets/rail_divider.dart new file mode 100644 index 0000000..07a20f5 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/rail_divider.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class RailDivider extends StatelessWidget { + const RailDivider({super.key}); + + @override + Widget build(BuildContext context) { + final c = Theme.of(context).dividerColor.withValues(alpha: 0.40); + return Container( + height: 18, + width: 1, + margin: const EdgeInsets.only(bottom: 6), + color: c, + alignment: Alignment.topRight, + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/screen_widget.dart b/wien_talks/wien_talks_flutter/lib/widgets/screen_widget.dart new file mode 100644 index 0000000..e1e43bb --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/screen_widget.dart @@ -0,0 +1,57 @@ +import 'dart:math'; + +import 'package:flutter/material.dart'; +import 'package:flutter_spinkit/flutter_spinkit.dart'; +import 'package:loader_overlay/loader_overlay.dart'; +import 'package:wien_talks_flutter/widgets/add_quote_fab.dart'; + +class ScreenWidget extends StatelessWidget { + final Widget child; + + const ScreenWidget({super.key, required this.child}); + + @override + Widget build(BuildContext context) { + return Scaffold( + floatingActionButton: AddQuoteFab(), + body: SafeArea( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: LoaderOverlay( + overlayWidgetBuilder: (_) { + switch (Random().nextInt(5)) { + case 0: + return Center( + child: CircularProgressIndicator(), + ); + case 1: + return Center( + child: SpinKitCubeGrid( + size: 50, color: Theme.of(context).primaryColor), + ); + case 2: + return Center( + child: SpinKitWave(color: Theme.of(context).primaryColor), + ); + case 3: + return Center( + child: + SpinKitHourGlass(color: Theme.of(context).primaryColor), + ); + case 4: + return Center( + child: SpinKitFadingCircle( + color: Theme.of(context).primaryColor), + ); + default: + return Center( + child: SpinKitPulsingGrid( + color: Theme.of(context).primaryColor), + ); + } + }, + child: child), + )), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/widgets/ubahn_tape.dart b/wien_talks/wien_talks_flutter/lib/widgets/ubahn_tape.dart new file mode 100644 index 0000000..59a2d6f --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/ubahn_tape.dart @@ -0,0 +1,193 @@ +import 'dart:math' as math; + +import 'package:flutter/material.dart'; + +class UbahnTape extends StatelessWidget { + const UbahnTape({ + super.key, + this.lat, + this.lon, + this.rotationDeg = 6, + this.maxLinesShown = 1, + this.stations = kViennaStationsSample, + }); + + final double? lat; + final double? lon; + final double rotationDeg; + final int maxLinesShown; + final List stations; + + @override + Widget build(BuildContext context) { + final lines = _resolveLines(); + final primary = lines.isNotEmpty + ? (kUbahnLineColors[lines.first] ?? _kNeutral) + : _kNeutral; + + final bg = primary.withValues(alpha: 0.30); + + return Transform.rotate( + angle: rotationDeg * math.pi / 180, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(3), + boxShadow: const [ + BoxShadow( + color: Color(0x33000000), + blurRadius: 4, + offset: Offset(0, 2), + ), + ], + border: Border.all( + color: primary.withValues(alpha: 0.35), + width: 1, + ), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 14, + height: 14, + alignment: Alignment.center, + decoration: BoxDecoration( + color: _uBlue, + borderRadius: BorderRadius.circular(3), + ), + child: const Text( + 'U', + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 10, + height: 1.0, + color: Colors.white, + ), + ), + ), + const SizedBox(width: 6), + if (lines.isNotEmpty) + ...lines.take(maxLinesShown).expand((line) => [ + _LineChip(line: line), + const SizedBox(width: 4), + ]), + ], + ), + ), + ); + } + + List _resolveLines() { + if (lat == null || lon == null) return const []; + final nearest = _nearestStation(stations, lat!, lon!); + return nearest?.lines ?? const []; + } +} + +class _LineChip extends StatelessWidget { + const _LineChip({required this.line}); + final String line; + + @override + Widget build(BuildContext context) { + final color = kUbahnLineColors[line] ?? _kNeutral; + final on = _onColor(color); + return Container( + padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), + decoration: BoxDecoration( + color: color, + borderRadius: BorderRadius.circular(999), + ), + child: Text( + line, + style: TextStyle( + color: on, + fontSize: 10, + fontWeight: FontWeight.w700, + height: 1.0, + letterSpacing: 0.2, + ), + ), + ); + } +} + +Color _onColor(Color bg) { + return ThemeData.estimateBrightnessForColor(bg) == Brightness.dark + ? Colors.white + : const Color(0xFF111111); +} + +const _uBlue = Color(0xFF1E88E5); // Vienna U sign-ish blue +const _kNeutral = Color(0xFF9E9E9E); + +// Official-ish line colors +const Map kUbahnLineColors = { + 'U1': Color(0xFFE20613), // red + 'U2': Color(0xFFA762A3), // purple + 'U3': Color(0xFFF29400), // orange + 'U4': Color(0xFF009640), // green + 'U5': Color(0xFF63318F), // violet (future) + 'U6': Color(0xFF8D5B2D), // brown +}; + +class UbahnStation { + const UbahnStation(this.name, this.lat, this.lon, this.lines); + final String name; + final double lat; + final double lon; + final List lines; // e.g., ['U1','U3'] +} + +UbahnStation? _nearestStation( + List stations, + double lat, + double lon, +) { + if (stations.isEmpty) return null; + UbahnStation best = stations.first; + double bestD = _haversine(best.lat, best.lon, lat, lon); + for (var i = 1; i < stations.length; i++) { + final s = stations[i]; + final d = _haversine(s.lat, s.lon, lat, lon); + if (d < bestD) { + best = s; + bestD = d; + } + } + return best; +} + +double _haversine(double lat1, double lon1, double lat2, double lon2) { + const R = 6371000.0; + final dLat = (lat2 - lat1) * (math.pi / 180.0); + final dLon = (lon2 - lon1) * (math.pi / 180.0); + final a = math.sin(dLat / 2) * math.sin(dLat / 2) + + math.cos(lat1 * (math.pi / 180.0)) * + math.cos(lat2 * (math.pi / 180.0)) * + math.sin(dLon / 2) * + math.sin(dLon / 2); + final c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a)); + return R * c; +} + +// Compact central sample; swap in full dataset when ready +const List kViennaStationsSample = [ + UbahnStation('Stephansplatz', 48.2084, 16.3731, ['U1', 'U3']), + UbahnStation('Karlsplatz', 48.2000, 16.3690, ['U1', 'U2', 'U4']), + UbahnStation('Schwedenplatz', 48.2111, 16.3776, ['U1', 'U4']), + UbahnStation('Praterstern', 48.2169, 16.3909, ['U1', 'U2']), + UbahnStation('Schottenring', 48.2152, 16.3720, ['U2', 'U4']), + UbahnStation('Volkstheater', 48.2078, 16.3604, ['U2', 'U3']), + UbahnStation('Museumsquartier', 48.2026, 16.3614, ['U2']), + UbahnStation('Westbahnhof', 48.1967, 16.3378, ['U3', 'U6']), + UbahnStation('Wien Mitte/Landstraße', 48.2070, 16.3834, ['U3', 'U4']), + UbahnStation('Spittelau', 48.2409, 16.3585, ['U4', 'U6']), + UbahnStation('Längenfeldgasse', 48.1848, 16.3299, ['U4', 'U6']), + UbahnStation('Erdberg', 48.1907, 16.4196, ['U3']), + UbahnStation('Kaisermühlen VIC', 48.2348, 16.4130, ['U1']), + UbahnStation('Floridsdorf', 48.2570, 16.4030, ['U6']), + UbahnStation('Ottakring', 48.2120, 16.3080, ['U3']), +]; diff --git a/wien_talks/wien_talks_flutter/lib/widgets/vote_button.dart b/wien_talks/wien_talks_flutter/lib/widgets/vote_button.dart new file mode 100644 index 0000000..92c242f --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/widgets/vote_button.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +import 'package:wien_talks_client/wien_talks_client.dart'; + +class VoteButton extends StatelessWidget { + const VoteButton({ + super.key, + required this.icon, + required this.semantics, + required this.count, + required this.onPressed, + required this.color, + }); + + final IconData icon; + final String semantics; + final int count; + final VoidCallback onPressed; + final Color color; + + @override + Widget build(BuildContext context) { + final t = Theme.of(context); + return Column( + children: [ + IconButton( + onPressed: onPressed, + icon: Icon(icon), + tooltip: semantics, + color: color, + iconSize: 20, + constraints: const BoxConstraints.tightFor(width: 36, height: 36), + padding: EdgeInsets.zero, + splashRadius: 20, + visualDensity: VisualDensity.compact, + ), + AnimatedSwitcher( + duration: const Duration(milliseconds: 150), + transitionBuilder: (child, anim) => + ScaleTransition(scale: anim, child: child), + child: Text( + '$count', + key: ValueKey(count), + style: t.textTheme.labelSmall, + textAlign: TextAlign.center, + ), + ), + ], + ); + } +} diff --git a/wien_talks/linux/.gitignore b/wien_talks/wien_talks_flutter/linux/.gitignore similarity index 100% rename from wien_talks/linux/.gitignore rename to wien_talks/wien_talks_flutter/linux/.gitignore diff --git a/wien_talks/linux/CMakeLists.txt b/wien_talks/wien_talks_flutter/linux/CMakeLists.txt similarity index 98% rename from wien_talks/linux/CMakeLists.txt rename to wien_talks/wien_talks_flutter/linux/CMakeLists.txt index 5783f68..6fff101 100644 --- a/wien_talks/linux/CMakeLists.txt +++ b/wien_talks/wien_talks_flutter/linux/CMakeLists.txt @@ -4,10 +4,10 @@ project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "wien_talks") +set(BINARY_NAME "wien_talks_flutter") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.wien_talks") +set(APPLICATION_ID "com.wien_talks") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/wien_talks/linux/flutter/CMakeLists.txt b/wien_talks/wien_talks_flutter/linux/flutter/CMakeLists.txt similarity index 100% rename from wien_talks/linux/flutter/CMakeLists.txt rename to wien_talks/wien_talks_flutter/linux/flutter/CMakeLists.txt diff --git a/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..64a0ece --- /dev/null +++ b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); +} diff --git a/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..2db3c22 --- /dev/null +++ b/wien_talks/wien_talks_flutter/linux/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + file_selector_linux +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/wien_talks/linux/runner/CMakeLists.txt b/wien_talks/wien_talks_flutter/linux/runner/CMakeLists.txt similarity index 100% rename from wien_talks/linux/runner/CMakeLists.txt rename to wien_talks/wien_talks_flutter/linux/runner/CMakeLists.txt diff --git a/wien_talks/linux/runner/main.cc b/wien_talks/wien_talks_flutter/linux/runner/main.cc similarity index 100% rename from wien_talks/linux/runner/main.cc rename to wien_talks/wien_talks_flutter/linux/runner/main.cc diff --git a/wien_talks/linux/runner/my_application.cc b/wien_talks/wien_talks_flutter/linux/runner/my_application.cc similarity index 97% rename from wien_talks/linux/runner/my_application.cc rename to wien_talks/wien_talks_flutter/linux/runner/my_application.cc index 5f266bf..cf9f64d 100644 --- a/wien_talks/linux/runner/my_application.cc +++ b/wien_talks/wien_talks_flutter/linux/runner/my_application.cc @@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "wien_talks"); + gtk_header_bar_set_title(header_bar, "wien_talks_flutter"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "wien_talks"); + gtk_window_set_title(window, "wien_talks_flutter"); } gtk_window_set_default_size(window, 1280, 720); diff --git a/wien_talks/linux/runner/my_application.h b/wien_talks/wien_talks_flutter/linux/runner/my_application.h similarity index 100% rename from wien_talks/linux/runner/my_application.h rename to wien_talks/wien_talks_flutter/linux/runner/my_application.h diff --git a/wien_talks/macos/.gitignore b/wien_talks/wien_talks_flutter/macos/.gitignore similarity index 100% rename from wien_talks/macos/.gitignore rename to wien_talks/wien_talks_flutter/macos/.gitignore diff --git a/wien_talks/macos/Flutter/Flutter-Debug.xcconfig b/wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Debug.xcconfig similarity index 100% rename from wien_talks/macos/Flutter/Flutter-Debug.xcconfig rename to wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Debug.xcconfig diff --git a/wien_talks/macos/Flutter/Flutter-Release.xcconfig b/wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Release.xcconfig similarity index 100% rename from wien_talks/macos/Flutter/Flutter-Release.xcconfig rename to wien_talks/wien_talks_flutter/macos/Flutter/Flutter-Release.xcconfig diff --git a/wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift b/wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..19702fe --- /dev/null +++ b/wien_talks/wien_talks_flutter/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,26 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import connectivity_plus +import file_picker +import file_selector_macos +import google_sign_in_ios +import location +import path_provider_foundation +import shared_preferences_foundation +import sqflite_darwin + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) + FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) + LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) +} diff --git a/wien_talks/macos/Runner.xcodeproj/project.pbxproj b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.pbxproj similarity index 96% rename from wien_talks/macos/Runner.xcodeproj/project.pbxproj rename to wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.pbxproj index 660f9ea..3ad623d 100644 --- a/wien_talks/macos/Runner.xcodeproj/project.pbxproj +++ b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.pbxproj @@ -64,7 +64,7 @@ 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* wien_talks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "wien_talks.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* wien_talks_flutter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "wien_talks_flutter.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -131,7 +131,7 @@ 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* wien_talks.app */, + 33CC10ED2044A3C60003C045 /* wien_talks_flutter.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -217,7 +217,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* wien_talks.app */; + productReference = 33CC10ED2044A3C60003C045 /* wien_talks_flutter.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -385,10 +385,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks_flutter"; }; name = Debug; }; @@ -399,10 +399,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks_flutter"; }; name = Release; }; @@ -413,10 +413,10 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/wien_talks_flutter.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/wien_talks_flutter"; }; name = Profile; }; diff --git a/wien_talks/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from wien_talks/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/wien_talks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 94% rename from wien_talks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 944b61b..d6b3630 100644 --- a/wien_talks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/wien_talks/wien_talks_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -66,7 +66,7 @@ @@ -83,7 +83,7 @@ diff --git a/wien_talks/macos/Runner.xcworkspace/contents.xcworkspacedata b/wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from wien_talks/macos/Runner.xcworkspace/contents.xcworkspacedata rename to wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/contents.xcworkspacedata diff --git a/wien_talks/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from wien_talks/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to wien_talks/wien_talks_flutter/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/wien_talks/macos/Runner/AppDelegate.swift b/wien_talks/wien_talks_flutter/macos/Runner/AppDelegate.swift similarity index 100% rename from wien_talks/macos/Runner/AppDelegate.swift rename to wien_talks/wien_talks_flutter/macos/Runner/AppDelegate.swift diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from wien_talks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to wien_talks/wien_talks_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/wien_talks/macos/Runner/Base.lproj/MainMenu.xib b/wien_talks/wien_talks_flutter/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from wien_talks/macos/Runner/Base.lproj/MainMenu.xib rename to wien_talks/wien_talks_flutter/macos/Runner/Base.lproj/MainMenu.xib diff --git a/wien_talks/macos/Runner/Configs/AppInfo.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/AppInfo.xcconfig similarity index 85% rename from wien_talks/macos/Runner/Configs/AppInfo.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/AppInfo.xcconfig index b757dda..8e125d2 100644 --- a/wien_talks/macos/Runner/Configs/AppInfo.xcconfig +++ b/wien_talks/wien_talks_flutter/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = wien_talks +PRODUCT_NAME = wien_talks_flutter // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalks +PRODUCT_BUNDLE_IDENTIFIER = com.example.wienTalksFlutter // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. diff --git a/wien_talks/macos/Runner/Configs/Debug.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from wien_talks/macos/Runner/Configs/Debug.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/Debug.xcconfig diff --git a/wien_talks/macos/Runner/Configs/Release.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from wien_talks/macos/Runner/Configs/Release.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/Release.xcconfig diff --git a/wien_talks/macos/Runner/Configs/Warnings.xcconfig b/wien_talks/wien_talks_flutter/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from wien_talks/macos/Runner/Configs/Warnings.xcconfig rename to wien_talks/wien_talks_flutter/macos/Runner/Configs/Warnings.xcconfig diff --git a/wien_talks/macos/Runner/DebugProfile.entitlements b/wien_talks/wien_talks_flutter/macos/Runner/DebugProfile.entitlements similarity index 86% rename from wien_talks/macos/Runner/DebugProfile.entitlements rename to wien_talks/wien_talks_flutter/macos/Runner/DebugProfile.entitlements index dddb8a3..3ba6c12 100644 --- a/wien_talks/macos/Runner/DebugProfile.entitlements +++ b/wien_talks/wien_talks_flutter/macos/Runner/DebugProfile.entitlements @@ -6,6 +6,8 @@ com.apple.security.cs.allow-jit + com.apple.security.network.client + com.apple.security.network.server diff --git a/wien_talks/macos/Runner/Info.plist b/wien_talks/wien_talks_flutter/macos/Runner/Info.plist similarity index 100% rename from wien_talks/macos/Runner/Info.plist rename to wien_talks/wien_talks_flutter/macos/Runner/Info.plist diff --git a/wien_talks/macos/Runner/MainFlutterWindow.swift b/wien_talks/wien_talks_flutter/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from wien_talks/macos/Runner/MainFlutterWindow.swift rename to wien_talks/wien_talks_flutter/macos/Runner/MainFlutterWindow.swift diff --git a/wien_talks/macos/Runner/Release.entitlements b/wien_talks/wien_talks_flutter/macos/Runner/Release.entitlements similarity index 81% rename from wien_talks/macos/Runner/Release.entitlements rename to wien_talks/wien_talks_flutter/macos/Runner/Release.entitlements index 852fa1a..ee95ab7 100644 --- a/wien_talks/macos/Runner/Release.entitlements +++ b/wien_talks/wien_talks_flutter/macos/Runner/Release.entitlements @@ -4,5 +4,7 @@ com.apple.security.app-sandbox + com.apple.security.network.client + diff --git a/wien_talks/macos/RunnerTests/RunnerTests.swift b/wien_talks/wien_talks_flutter/macos/RunnerTests/RunnerTests.swift similarity index 100% rename from wien_talks/macos/RunnerTests/RunnerTests.swift rename to wien_talks/wien_talks_flutter/macos/RunnerTests/RunnerTests.swift diff --git a/wien_talks/wien_talks_flutter/pubspec.yaml b/wien_talks/wien_talks_flutter/pubspec.yaml new file mode 100644 index 0000000..e5c9b8d --- /dev/null +++ b/wien_talks/wien_talks_flutter/pubspec.yaml @@ -0,0 +1,250 @@ +name: wien_talks_flutter +description: A new Flutter project with Serverpod. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: '>=3.5.0 <4.0.0' + flutter: '>=3.24.0' + +dependencies: + flutter: + sdk: flutter + + carousel_slider: ^5.1.1 + + flutter_spinkit: ^5.2.2 + + google_fonts: ^6.3.0 + + go_router: ^16.1.0 + + loader_overlay: ^5.0.0 + + location: ^8.0.1 + + mapsforge_flutter: ^3.0.2 + + rxdart: ^0.28.0 + + serverpod_flutter: 2.9.1 + + wien_talks_client: + path: ../wien_talks_client + serverpod_auth_shared_flutter: ^2.9.1 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + google_sign_in: ^7.1.1 + flutter_staggered_grid_view: ^0.7.0 + cached_network_image: ^3.4.1 + flutter_dotenv: ^5.2.1 + +dev_dependencies: + flutter_lints: '>=3.0.0 <7.0.0' + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - .env + - assets/funny_images/ + - assets/render_themes/ + - packages/mapsforge_flutter/assets/patterns/dark_farmland.svg + - packages/mapsforge_flutter/assets/patterns/dark_military.png + - packages/mapsforge_flutter/assets/patterns/coniferous.svg + - packages/mapsforge_flutter/assets/patterns/coniferous_and_deciduous.svg + - packages/mapsforge_flutter/assets/patterns/deciduous.svg + - packages/mapsforge_flutter/assets/patterns/farmland.svg + - packages/mapsforge_flutter/assets/patterns/grass.svg + - packages/mapsforge_flutter/assets/patterns/hills.svg + - packages/mapsforge_flutter/assets/patterns/quarry.svg + - packages/mapsforge_flutter/assets/patterns/scrub.svg + - packages/mapsforge_flutter/assets/patterns/swamp.svg + - packages/mapsforge_flutter/assets/patterns/access-destination.png + - packages/mapsforge_flutter/assets/patterns/access-private.png + - packages/mapsforge_flutter/assets/patterns/arrow.png + - packages/mapsforge_flutter/assets/patterns/cemetery.png + - packages/mapsforge_flutter/assets/patterns/deciduous.svg + - packages/mapsforge_flutter/assets/patterns/dot.png + - packages/mapsforge_flutter/assets/patterns/farmland.svg + - packages/mapsforge_flutter/assets/patterns/grass.svg + - packages/mapsforge_flutter/assets/patterns/hills.svg + - packages/mapsforge_flutter/assets/patterns/marsh.png + - packages/mapsforge_flutter/assets/patterns/military.png + - packages/mapsforge_flutter/assets/patterns/nature-reserve.png + - packages/mapsforge_flutter/assets/patterns/pike.png + - packages/mapsforge_flutter/assets/patterns/quarry.svg + - packages/mapsforge_flutter/assets/patterns/rail.png + - packages/mapsforge_flutter/assets/patterns/scrub.svg + - packages/mapsforge_flutter/assets/patterns/swamp.svg + - packages/mapsforge_flutter/assets/patterns/wood-coniferous.png + - packages/mapsforge_flutter/assets/patterns/wood-deciduous.png + - packages/mapsforge_flutter/assets/patterns/wood-mixed.png + - packages/mapsforge_flutter/assets/symbols/bench.svg + - packages/mapsforge_flutter/assets/symbols/cable_car.svg + - packages/mapsforge_flutter/assets/symbols/chair_lift.svg + - packages/mapsforge_flutter/assets/symbols/dot_black.svg + - packages/mapsforge_flutter/assets/symbols/dot_blue.svg + - packages/mapsforge_flutter/assets/symbols/dot_blue_dark.svg + - packages/mapsforge_flutter/assets/symbols/dot_magenta.svg + - packages/mapsforge_flutter/assets/symbols/dot_white.svg + - packages/mapsforge_flutter/assets/symbols/gondola.svg + - packages/mapsforge_flutter/assets/symbols/oneway.svg + - packages/mapsforge_flutter/assets/symbols/peak.svg + - packages/mapsforge_flutter/assets/symbols/railway-crossing-small.svg + - packages/mapsforge_flutter/assets/symbols/railway-crossing.svg + - packages/mapsforge_flutter/assets/symbols/traffic_signal.svg + - packages/mapsforge_flutter/assets/symbols/volcano.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/alpinehut.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/camping.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/caravan_park.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/chalet.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/hostel.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/hotel2.svg + - packages/mapsforge_flutter/assets/symbols/accommodation/shelter2.svg + - packages/mapsforge_flutter/assets/symbols/amenity/firestation3.svg + - packages/mapsforge_flutter/assets/symbols/amenity/fountain2.svg + - packages/mapsforge_flutter/assets/symbols/amenity/library.svg + - packages/mapsforge_flutter/assets/symbols/amenity/playground.svg + - packages/mapsforge_flutter/assets/symbols/amenity/police2.svg + - packages/mapsforge_flutter/assets/symbols/amenity/post_box.svg + - packages/mapsforge_flutter/assets/symbols/amenity/post_office.svg + - packages/mapsforge_flutter/assets/symbols/amenity/recycling.svg + - packages/mapsforge_flutter/assets/symbols/amenity/telephone.svg + - packages/mapsforge_flutter/assets/symbols/amenity/toilets.svg + - packages/mapsforge_flutter/assets/symbols/barrier/blocks.svg + - packages/mapsforge_flutter/assets/symbols/barrier/bollard.svg + - packages/mapsforge_flutter/assets/symbols/barrier/cycle_barrier.svg + - packages/mapsforge_flutter/assets/symbols/barrier/gate.svg + - packages/mapsforge_flutter/assets/symbols/barrier/lift_gate.svg + - packages/mapsforge_flutter/assets/symbols/barrier/stile.svg + - packages/mapsforge_flutter/assets/symbols/custom/amenity/fountain2.svg + - packages/mapsforge_flutter/assets/symbols/custom/amenity/library.svg + - packages/mapsforge_flutter/assets/symbols/custom/amenity/toilets.svg + - packages/mapsforge_flutter/assets/symbols/custom/money/atm2.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/archaeological2.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/attraction.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/castle2.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/cinema2.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/information.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/memorial.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/monument.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/museum.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/ruin.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/theatre.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/view_point.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/windmill.svg + - packages/mapsforge_flutter/assets/symbols/custom/tourist/zoo.svg + - packages/mapsforge_flutter/assets/symbols/education/nursery3.svg + - packages/mapsforge_flutter/assets/symbols/education/school.svg + - packages/mapsforge_flutter/assets/symbols/education/university.svg + - packages/mapsforge_flutter/assets/symbols/food/bar.svg + - packages/mapsforge_flutter/assets/symbols/food/biergarten.svg + - packages/mapsforge_flutter/assets/symbols/food/cafe.svg + - packages/mapsforge_flutter/assets/symbols/food/drinkingtap.svg + - packages/mapsforge_flutter/assets/symbols/food/fastfood.svg + - packages/mapsforge_flutter/assets/symbols/food/pub.svg + - packages/mapsforge_flutter/assets/symbols/food/restaurant.svg + - packages/mapsforge_flutter/assets/symbols/health/doctors2.svg + - packages/mapsforge_flutter/assets/symbols/health/hospital.svg + - packages/mapsforge_flutter/assets/symbols/health/pharmacy.svg + - packages/mapsforge_flutter/assets/symbols/money/atm2.svg + - packages/mapsforge_flutter/assets/symbols/money/bank2.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/buddhist.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/christian.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/hindu.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/islamic.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/jewish.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/shinto.svg + - packages/mapsforge_flutter/assets/symbols/place_of_worship/unknown.svg + - packages/mapsforge_flutter/assets/symbols/poi/cave.svg + - packages/mapsforge_flutter/assets/symbols/poi/embassy2.svg + - packages/mapsforge_flutter/assets/symbols/poi/mountain_pass.svg + - packages/mapsforge_flutter/assets/symbols/shopping/alcohol.svg + - packages/mapsforge_flutter/assets/symbols/shopping/bakery.svg + - packages/mapsforge_flutter/assets/symbols/shopping/bicycle.svg + - packages/mapsforge_flutter/assets/symbols/shopping/book.svg + - packages/mapsforge_flutter/assets/symbols/shopping/butcher.svg + - packages/mapsforge_flutter/assets/symbols/shopping/car_repair.svg + - packages/mapsforge_flutter/assets/symbols/shopping/convenience.svg + - packages/mapsforge_flutter/assets/symbols/shopping/diy.svg + - packages/mapsforge_flutter/assets/symbols/shopping/greengrocer.svg + - packages/mapsforge_flutter/assets/symbols/shopping/laundrette.svg + - packages/mapsforge_flutter/assets/symbols/shopping/marketplace.svg + - packages/mapsforge_flutter/assets/symbols/shopping/supermarket.svg + - packages/mapsforge_flutter/assets/symbols/sport/golf.svg + - packages/mapsforge_flutter/assets/symbols/sport/shooting.svg + - packages/mapsforge_flutter/assets/symbols/sport/soccer.svg + - packages/mapsforge_flutter/assets/symbols/sport/stadium.svg + - packages/mapsforge_flutter/assets/symbols/sport/swimming_outdoor.svg + - packages/mapsforge_flutter/assets/symbols/sport/tennis.svg + - packages/mapsforge_flutter/assets/symbols/tourist/archaeological2.svg + - packages/mapsforge_flutter/assets/symbols/tourist/attraction.svg + - packages/mapsforge_flutter/assets/symbols/tourist/castle2.svg + - packages/mapsforge_flutter/assets/symbols/tourist/cinema2.svg + - packages/mapsforge_flutter/assets/symbols/tourist/information.svg + - packages/mapsforge_flutter/assets/symbols/tourist/memorial.svg + - packages/mapsforge_flutter/assets/symbols/tourist/monument.svg + - packages/mapsforge_flutter/assets/symbols/tourist/museum.svg + - packages/mapsforge_flutter/assets/symbols/tourist/picnic.svg + - packages/mapsforge_flutter/assets/symbols/tourist/ruin.svg + - packages/mapsforge_flutter/assets/symbols/tourist/theatre.svg + - packages/mapsforge_flutter/assets/symbols/tourist/view_point.svg + - packages/mapsforge_flutter/assets/symbols/tourist/windmill.svg + - packages/mapsforge_flutter/assets/symbols/tourist/zoo.svg + - packages/mapsforge_flutter/assets/symbols/transport/airport2.svg + - packages/mapsforge_flutter/assets/symbols/transport/bus_station.svg + - packages/mapsforge_flutter/assets/symbols/transport/bus_stop.svg + - packages/mapsforge_flutter/assets/symbols/transport/fuel.svg + - packages/mapsforge_flutter/assets/symbols/transport/helicopter.svg + - packages/mapsforge_flutter/assets/symbols/transport/lighthouse.svg + - packages/mapsforge_flutter/assets/symbols/transport/parking.svg + - packages/mapsforge_flutter/assets/symbols/transport/parking_private.svg + - packages/mapsforge_flutter/assets/symbols/transport/rental_bicycle.svg + - packages/mapsforge_flutter/assets/symbols/transport/slipway.svg + - packages/mapsforge_flutter/assets/symbols/transport/traffic_lights.svg + - packages/mapsforge_flutter/assets/symbols/transport/train_station2.svg + - packages/mapsforge_flutter/assets/symbols/transport/tram_stop.svg + - packages/mapsforge_flutter/assets/symbols/water/weir.svg + - packages/mapsforge_flutter/assets/symbols/windsock.svg + - packages/mapsforge_flutter/assets/symbols/viewpoint.svg + + fonts: + - family: serif + fonts: + - asset: packages/mapsforge_flutter/assets/fonts/FreeSerif.otf + - asset: packages/mapsforge_flutter/assets/fonts/FreeSerifBold.otf + weight: 700 + - asset: packages/mapsforge_flutter/assets/fonts/FreeSerifBoldItalic.otf + style: italic + weight: 700 + - asset: packages/mapsforge_flutter/assets/fonts/FreeSerifItalic.otf + style: italic diff --git a/wien_talks/wien_talks_flutter/test/widget_test.dart b/wien_talks/wien_talks_flutter/test/widget_test.dart new file mode 100644 index 0000000..ac1458c --- /dev/null +++ b/wien_talks/wien_talks_flutter/test/widget_test.dart @@ -0,0 +1,15 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +// import 'package:flutter/material.dart'; +// import 'package:flutter_test/flutter_test.dart'; +// +// import 'package:PROJECTNAME_flutter/main.dart'; + +void main() { + // Add your app tests here +} diff --git a/wien_talks/web/favicon.png b/wien_talks/wien_talks_flutter/web/favicon.png similarity index 100% rename from wien_talks/web/favicon.png rename to wien_talks/wien_talks_flutter/web/favicon.png diff --git a/wien_talks/web/icons/Icon-192.png b/wien_talks/wien_talks_flutter/web/icons/Icon-192.png similarity index 100% rename from wien_talks/web/icons/Icon-192.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-192.png diff --git a/wien_talks/web/icons/Icon-512.png b/wien_talks/wien_talks_flutter/web/icons/Icon-512.png similarity index 100% rename from wien_talks/web/icons/Icon-512.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-512.png diff --git a/wien_talks/web/icons/Icon-maskable-192.png b/wien_talks/wien_talks_flutter/web/icons/Icon-maskable-192.png similarity index 100% rename from wien_talks/web/icons/Icon-maskable-192.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-maskable-192.png diff --git a/wien_talks/web/icons/Icon-maskable-512.png b/wien_talks/wien_talks_flutter/web/icons/Icon-maskable-512.png similarity index 100% rename from wien_talks/web/icons/Icon-maskable-512.png rename to wien_talks/wien_talks_flutter/web/icons/Icon-maskable-512.png diff --git a/wien_talks/web/index.html b/wien_talks/wien_talks_flutter/web/index.html similarity index 91% rename from wien_talks/web/index.html rename to wien_talks/wien_talks_flutter/web/index.html index ade8429..29b4e1a 100644 --- a/wien_talks/web/index.html +++ b/wien_talks/wien_talks_flutter/web/index.html @@ -23,13 +23,13 @@ - + - wien_talks + wien_talks_flutter diff --git a/wien_talks/web/manifest.json b/wien_talks/wien_talks_flutter/web/manifest.json similarity index 92% rename from wien_talks/web/manifest.json rename to wien_talks/wien_talks_flutter/web/manifest.json index b8b6ffb..66c2000 100644 --- a/wien_talks/web/manifest.json +++ b/wien_talks/wien_talks_flutter/web/manifest.json @@ -1,6 +1,6 @@ { - "name": "wien_talks", - "short_name": "wien_talks", + "name": "wien_talks_flutter", + "short_name": "wien_talks_flutter", "start_url": ".", "display": "standalone", "background_color": "#0175C2", diff --git a/wien_talks/windows/.gitignore b/wien_talks/wien_talks_flutter/windows/.gitignore similarity index 100% rename from wien_talks/windows/.gitignore rename to wien_talks/wien_talks_flutter/windows/.gitignore diff --git a/wien_talks/windows/CMakeLists.txt b/wien_talks/wien_talks_flutter/windows/CMakeLists.txt similarity index 98% rename from wien_talks/windows/CMakeLists.txt rename to wien_talks/wien_talks_flutter/windows/CMakeLists.txt index 77c88ba..78f6d56 100644 --- a/wien_talks/windows/CMakeLists.txt +++ b/wien_talks/wien_talks_flutter/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(wien_talks LANGUAGES CXX) +project(wien_talks_flutter LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "wien_talks") +set(BINARY_NAME "wien_talks_flutter") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/wien_talks/windows/flutter/CMakeLists.txt b/wien_talks/wien_talks_flutter/windows/flutter/CMakeLists.txt similarity index 100% rename from wien_talks/windows/flutter/CMakeLists.txt rename to wien_talks/wien_talks_flutter/windows/flutter/CMakeLists.txt diff --git a/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..e6c6668 --- /dev/null +++ b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,17 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); +} diff --git a/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..d62d824 --- /dev/null +++ b/wien_talks/wien_talks_flutter/windows/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus + file_selector_windows +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/wien_talks/windows/runner/CMakeLists.txt b/wien_talks/wien_talks_flutter/windows/runner/CMakeLists.txt similarity index 100% rename from wien_talks/windows/runner/CMakeLists.txt rename to wien_talks/wien_talks_flutter/windows/runner/CMakeLists.txt diff --git a/wien_talks/windows/runner/Runner.rc b/wien_talks/wien_talks_flutter/windows/runner/Runner.rc similarity index 91% rename from wien_talks/windows/runner/Runner.rc rename to wien_talks/wien_talks_flutter/windows/runner/Runner.rc index e2a0e65..059c599 100644 --- a/wien_talks/windows/runner/Runner.rc +++ b/wien_talks/wien_talks_flutter/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "wien_talks" "\0" + VALUE "FileDescription", "wien_talks_flutter" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "wien_talks" "\0" + VALUE "InternalName", "wien_talks_flutter" "\0" VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "wien_talks.exe" "\0" - VALUE "ProductName", "wien_talks" "\0" + VALUE "OriginalFilename", "wien_talks_flutter.exe" "\0" + VALUE "ProductName", "wien_talks_flutter" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/wien_talks/windows/runner/flutter_window.cpp b/wien_talks/wien_talks_flutter/windows/runner/flutter_window.cpp similarity index 100% rename from wien_talks/windows/runner/flutter_window.cpp rename to wien_talks/wien_talks_flutter/windows/runner/flutter_window.cpp diff --git a/wien_talks/windows/runner/flutter_window.h b/wien_talks/wien_talks_flutter/windows/runner/flutter_window.h similarity index 100% rename from wien_talks/windows/runner/flutter_window.h rename to wien_talks/wien_talks_flutter/windows/runner/flutter_window.h diff --git a/wien_talks/windows/runner/main.cpp b/wien_talks/wien_talks_flutter/windows/runner/main.cpp similarity index 95% rename from wien_talks/windows/runner/main.cpp rename to wien_talks/wien_talks_flutter/windows/runner/main.cpp index 61843e4..04a2d6a 100644 --- a/wien_talks/windows/runner/main.cpp +++ b/wien_talks/wien_talks_flutter/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"wien_talks", origin, size)) { + if (!window.Create(L"wien_talks_flutter", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/wien_talks/windows/runner/resource.h b/wien_talks/wien_talks_flutter/windows/runner/resource.h similarity index 100% rename from wien_talks/windows/runner/resource.h rename to wien_talks/wien_talks_flutter/windows/runner/resource.h diff --git a/wien_talks/windows/runner/resources/app_icon.ico b/wien_talks/wien_talks_flutter/windows/runner/resources/app_icon.ico similarity index 100% rename from wien_talks/windows/runner/resources/app_icon.ico rename to wien_talks/wien_talks_flutter/windows/runner/resources/app_icon.ico diff --git a/wien_talks/windows/runner/runner.exe.manifest b/wien_talks/wien_talks_flutter/windows/runner/runner.exe.manifest similarity index 100% rename from wien_talks/windows/runner/runner.exe.manifest rename to wien_talks/wien_talks_flutter/windows/runner/runner.exe.manifest diff --git a/wien_talks/windows/runner/utils.cpp b/wien_talks/wien_talks_flutter/windows/runner/utils.cpp similarity index 100% rename from wien_talks/windows/runner/utils.cpp rename to wien_talks/wien_talks_flutter/windows/runner/utils.cpp diff --git a/wien_talks/windows/runner/utils.h b/wien_talks/wien_talks_flutter/windows/runner/utils.h similarity index 100% rename from wien_talks/windows/runner/utils.h rename to wien_talks/wien_talks_flutter/windows/runner/utils.h diff --git a/wien_talks/windows/runner/win32_window.cpp b/wien_talks/wien_talks_flutter/windows/runner/win32_window.cpp similarity index 100% rename from wien_talks/windows/runner/win32_window.cpp rename to wien_talks/wien_talks_flutter/windows/runner/win32_window.cpp diff --git a/wien_talks/windows/runner/win32_window.h b/wien_talks/wien_talks_flutter/windows/runner/win32_window.h similarity index 100% rename from wien_talks/windows/runner/win32_window.h rename to wien_talks/wien_talks_flutter/windows/runner/win32_window.h diff --git a/wien_talks/wien_talks_server/.env.template b/wien_talks/wien_talks_server/.env.template new file mode 100644 index 0000000..f44571b --- /dev/null +++ b/wien_talks/wien_talks_server/.env.template @@ -0,0 +1,3 @@ +POSTGRES_USER=postgres +POSTGRES_DB=wien_talks +POSTGRES_PASSWORD=sergtsop diff --git a/wien_talks/wien_talks_server/.gcloudignore b/wien_talks/wien_talks_server/.gcloudignore new file mode 100644 index 0000000..3d64647 --- /dev/null +++ b/wien_talks/wien_talks_server/.gcloudignore @@ -0,0 +1,9 @@ +# Files and directories created by pub +.dart_tool/ +.packages + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ diff --git a/wien_talks/wien_talks_server/.gitignore b/wien_talks/wien_talks_server/.gitignore new file mode 100644 index 0000000..b6ab210 --- /dev/null +++ b/wien_talks/wien_talks_server/.gitignore @@ -0,0 +1,19 @@ +# Files and directories created by pub +.dart_tool/ +.packages + +# Conventional directory for build outputs +build/ + +# Directory created by dartdoc +doc/api/ + +# Passwords file +config/passwords.yaml + +# Firebase service account key for Firebase auth +config/firebase_service_account_key.json + +.env +*.env +config/ \ No newline at end of file diff --git a/wien_talks/wien_talks_server/CHANGELOG.md b/wien_talks/wien_talks_server/CHANGELOG.md new file mode 100644 index 0000000..687440b --- /dev/null +++ b/wien_talks/wien_talks_server/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version, created by Stagehand diff --git a/wien_talks/wien_talks_server/Dockerfile b/wien_talks/wien_talks_server/Dockerfile new file mode 100644 index 0000000..8c71ffc --- /dev/null +++ b/wien_talks/wien_talks_server/Dockerfile @@ -0,0 +1,41 @@ +# Build stage +FROM dart:3.5.0 AS build +WORKDIR /app +# TODO: more fine-grained building +COPY . . + +# Install dependencies and compile the server executable +RUN dart pub get +RUN dart compile exe bin/main.dart -o bin/server + +# Final stage +FROM alpine:3.22 + +# Environment variables +ENV runmode=production +ENV serverid=default +ENV logging=normal +ENV role=monolith + +# Copy runtime dependencies +COPY --from=build /runtime/ / + +# Copy compiled server executable +COPY --from=build /app/bin/server server + +# Copy configuration files and resources +# TODO: don't copy entire config dir, only what's needed +COPY --from=build /app/config/ config/ +COPY --from=build /app/web/ web/ +COPY --from=build /app/migrations/ migrations/ + +# This file is required to enable the endpoint log filter in Insights. +COPY --from=build /app/lib/src/generated/protocol.yaml lib/src/generated/protocol.yaml + +# Expose ports +EXPOSE 8080 +EXPOSE 8081 +EXPOSE 8082 + +ENTRYPOINT ["/server"] +CMD ["--mode", "production", "--server-id", "default", "--logging", "normal", "--role", "monolith"] diff --git a/wien_talks/wien_talks_server/Makefile b/wien_talks/wien_talks_server/Makefile new file mode 100644 index 0000000..194a388 --- /dev/null +++ b/wien_talks/wien_talks_server/Makefile @@ -0,0 +1,76 @@ +include ../defines.mk + +COMPOSE_FILE_LOCAL = docker-compose.local.yaml +COMPOSE_FILE_DEPLOY = docker-compose.deploy.yaml + +# NOTE: the --env-file flags are necessary because the env_file directive +# in the docker-compose.yaml doesn't work for env vars that are used inside the +# compose file itself. +# This is jank, but it is what it is <.< +COMPOSE_COMMON_ARGS_DEPLOY = -f $(COMPOSE_FILE_DEPLOY) \ + --env-file env.d/postgres.env \ + --env-file env.d/server.env \ + + +# Basically the current directory's name, so wien_talks_server +COMPOSE_PROJECT := $(shell basename $(shell pwd)) + +DEPLOY_NETWORK = docker-net + +.env: .env.template + cp -a .env.template .env + +.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 + +local-clean: local-down + for VOLUME in $(shell docker compose -f $(COMPOSE_FILE_LOCAL) volumes -q); \ + do docker volume rm "$$VOLUME"; done + +.PHONY: deploy deploy-env deploy-build deploy-stop deploy-down +deploy: + if test -z "$$(docker network ls -q --filter name=$(DEPLOY_NETWORK))"; then \ + docker network create --driver bridge $(DEPLOY_NETWORK); fi + docker compose $(COMPOSE_COMMON_ARGS_DEPLOY) up -d + +# TODO: parameterize .env files +deploy-env: env.d/postgres.env.template env.d/server.env.template + if test -e env.d/postgres.env; then echo "env.d/postgres.env already exists"; exit 1; fi + if test -e env.d/server.env; then echo "env.d/server.env already exists"; exit 1; fi + cp -a env.d/postgres.env.template env.d/postgres.env + cp -a env.d/server.env.template env.d/server.env + @echo -e "\n!!! Environment files for deployment initialized !!!\n\nDon't forget to edit them!" + +deploy-build: + docker compose $(COMPOSE_COMMON_ARGS_DEPLOY) build --no-cache + +deploy-stop: + if test -n "$$(docker network ls -q --filter name=$(DEPLOY_NETWORK))"; then \ + docker compose $(COMPOSE_COMMON_ARGS_DEPLOY) stop; fi + +deploy-down: + if test -n "$$(docker network ls -q --filter name=$(DEPLOY_NETWORK))"; then \ + docker compose $(COMPOSE_COMMON_ARGS_DEPLOY) down; fi + +# Note: Doesn't clean up DB for safety reasons! +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." \ No newline at end of file diff --git a/wien_talks/wien_talks_server/README.md b/wien_talks/wien_talks_server/README.md new file mode 100644 index 0000000..d632aba --- /dev/null +++ b/wien_talks/wien_talks_server/README.md @@ -0,0 +1,43 @@ +# Wien Talks: Server + +## Local Development Environment + +Setting up a local postgres container, run the following: + +```bash +make local +``` + +This will first create an `.env` file with default values and then launch the +container. + +You can then launch the Serverpod server like so: + +```bash +dart bin/main.dart +``` + +If your database schema isn't initialized yet, you will have to run the +following: + +```bash +dart bin/main.dart --apply-migrations +``` + +See the `Makefile` for all targets. + +## Passwords + +The password used in your environment files (`.env` for local development and +`env.d/postgres.env.template` for deployment) must correspond to the password in +`config/passwords.yaml`. + +The `config/passwords.yaml` file must be created manually at the moment; for +example: + +```yaml +development: + database: your-password-here +``` + + diff --git a/wien_talks/wien_talks_server/analysis_options.yaml b/wien_talks/wien_talks_server/analysis_options.yaml new file mode 100644 index 0000000..8847d6e --- /dev/null +++ b/wien_talks/wien_talks_server/analysis_options.yaml @@ -0,0 +1,31 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +linter: + rules: + unawaited_futures: true + avoid_print: true + +analyzer: + exclude: + - lib/src/generated/** + - test/integration/test_tools/serverpod_test_tools.dart +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/wien_talks/wien_talks_server/bin/main.dart b/wien_talks/wien_talks_server/bin/main.dart new file mode 100644 index 0000000..8b08e8e --- /dev/null +++ b/wien_talks/wien_talks_server/bin/main.dart @@ -0,0 +1,7 @@ +import 'package:wien_talks_server/server.dart'; + +/// This is the starting point for your Serverpod server. Typically, there is +/// no need to modify this file. +void main(List args) { + run(args); +} diff --git a/wien_talks/wien_talks_server/config/development.yaml b/wien_talks/wien_talks_server/config/development.yaml new file mode 100644 index 0000000..4ae91a9 --- /dev/null +++ b/wien_talks/wien_talks_server/config/development.yaml @@ -0,0 +1,58 @@ +# This is the configuration file for your local development environment. By +# default, it runs a single server on port 8080. To set up your server, you will +# need to add the name of the database you are connecting to and the user name. +# The password for the database is stored in the config/passwords.yaml. +# +# When running your server locally, the server ports are the same as the public +# facing ports. + +# Configuration for the main API server. +apiServer: + port: 8080 + publicHost: localhost + publicPort: 8080 + publicScheme: http + +# Configuration for the Insights server. +insightsServer: + port: 8081 + publicHost: localhost + publicPort: 8081 + publicScheme: http + +# Configuration for the web server. +webServer: + port: 8082 + publicHost: localhost + publicPort: 8082 + publicScheme: http + +# This is the database setup for your server. +database: + host: localhost + port: 8090 + name: wien_talks + user: postgres + #requireSsl: true # defaults to false + #isUnixSocket: true # defaults to false + +# This is the setup for Redis. +redis: + enabled: false + host: localhost + port: 8091 + #user: # defaults to empty + #requireSsl: true # defaults to false + +maxRequestSize: 524288 # The maximum size of requests allowed in bytes + +sessionLogs: + persistentEnabled: true + consoleEnabled: true + consoleLogFormat: text # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/config/generator.yaml b/wien_talks/wien_talks_server/config/generator.yaml new file mode 100644 index 0000000..74d9772 --- /dev/null +++ b/wien_talks/wien_talks_server/config/generator.yaml @@ -0,0 +1,4 @@ +type: server + +client_package_path: ../wien_talks_client +server_test_tools_path: test/integration/test_tools diff --git a/wien_talks/wien_talks_server/config/production.yaml b/wien_talks/wien_talks_server/config/production.yaml new file mode 100644 index 0000000..036949f --- /dev/null +++ b/wien_talks/wien_talks_server/config/production.yaml @@ -0,0 +1,62 @@ +# This is the configuration file for your production environment. +# Typically, you will want to route the traffic through a load balancer +# which adds SSL security through https. If you use Serverpod's standard +# Terraform scripts to deploy your server, all you need to change in +# this file is the examplepod.com domain name. + +# Configuration for the main API server. +apiServer: + port: 8080 + publicHost: api.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the Insights server. +insightsServer: + port: 8081 + publicHost: insights.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the web server. +webServer: + port: 8082 + publicHost: app.examplepod.com + publicPort: 443 + publicScheme: https + +# This is the database setup for your servers. The default for the Google Cloud +# Engine Terraform configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. database.examplepod.com. +database: + host: database.private-production.examplepod.com + port: 5432 + name: serverpod + user: postgres + requireSsl: true + #isUnixSocket: true # defaults to false + +# This is the setup for Redis. The default for the Google Cloud Engine Terraform +# configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. redis.examplepod.com. +redis: + enabled: false + host: redis.private-production.examplepod.com + port: 6379 + #user: # defaults to empty + #requireSsl: true # defaults to false + +maxRequestSize: 524288 # The maximum size of requests allowed in bytes + +sessionLogs: + consoleEnabled: false +# persistentEnabled: true +# consoleLogFormat: json # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/config/staging.yaml b/wien_talks/wien_talks_server/config/staging.yaml new file mode 100644 index 0000000..1c731b2 --- /dev/null +++ b/wien_talks/wien_talks_server/config/staging.yaml @@ -0,0 +1,66 @@ +# This is the configuration file for your staging environment. The staging +# environment is meant to resemble the production environment as much as +# possible and may connect to production databases services and data. You use it +# for final testing before deploying the production server. +# +# Typically, you will want to route the traffic through a load balancer +# which adds SSL security through https. If you use Serverpod's standard +# Terraform scripts to deploy your server, all you need to change in +# this file is the examplepod.com domain name. + +# Configuration for the main API server. +apiServer: + port: 8080 + publicHost: api-staging.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the Insights server. +insightsServer: + port: 8081 + publicHost: insights-staging.examplepod.com + publicPort: 443 + publicScheme: https + +# Configuration for the web server. +webServer: + port: 8082 + publicHost: app-staging.examplepod.com + publicPort: 443 + publicScheme: https + +# This is the database setup for your servers. The default for the Google Cloud +# Engine Terraform configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. database-staging.examplepod.com. +database: + host: database.private-staging.examplepod.com + port: 5432 + name: serverpod + user: postgres + requireSsl: true + #isUnixSocket: true # defaults to false + +# This is the setup for Redis. The default for the Google Cloud Engine Terraform +# configuration is to connect on a private IP address. +# If you are connecting on a public IP (e.g. on AWS or Google Cloud Run), you +# connect on the public IP of the database e.g. redis-staging.examplepod.com. +redis: + enabled: false + host: redis.private-staging.examplepod.com + port: 6379 + #user: # defaults to empty + #requireSsl: true # defaults to false + +maxRequestSize: 524288 # The maximum size of requests allowed in bytes + +sessionLogs: +# persistentEnabled: true +# consoleEnabled: true +# consoleLogFormat: json # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/config/test.yaml b/wien_talks/wien_talks_server/config/test.yaml new file mode 100644 index 0000000..1ee6c12 --- /dev/null +++ b/wien_talks/wien_talks_server/config/test.yaml @@ -0,0 +1,55 @@ +# This is the configuration file for your test environment. +# All ports are set to zero in this file which makes the server find the next available port. +# This is needed to enable running tests concurrently. To set up your server, you will +# need to add the name of the database you are connecting to and the user name. +# The password for the database is stored in the config/passwords.yaml. +# +# When running your server locally, the server ports are the same as the public +# facing ports. + +# Configuration for the main API test server. +apiServer: + port: 0 + publicHost: localhost + publicPort: 0 + publicScheme: http + +# Configuration for the Insights test server. +insightsServer: + port: 0 + publicHost: localhost + publicPort: 0 + publicScheme: http + +# Configuration for the web test server. +webServer: + port: 0 + publicHost: localhost + publicPort: 0 + publicScheme: http + +# This is the database setup for your test server. +database: + host: localhost + port: 9090 + name: wien_talks_test + user: postgres + +# This is the setup for your Redis test instance. +redis: + enabled: false + host: localhost + port: 9091 + #user: # defaults to empty + #requireSsl: true # defaults to false + +sessionLogs: + persistentEnabled: true + consoleEnabled: true +# consoleLogFormat: json # Defaults to "json", options are "text" or "json" + +# futureCallExecutionEnabled: true # Defaults to true + +#futureCall: +# concurrencyLimit: 1 # Defaults to 1, a negative or null value removes the limit +# scanInterval: 5000 # Unit in milliseconds, defaults to 5000 diff --git a/wien_talks/wien_talks_server/dart_test.yaml b/wien_talks/wien_talks_server/dart_test.yaml new file mode 100644 index 0000000..2b60c7d --- /dev/null +++ b/wien_talks/wien_talks_server/dart_test.yaml @@ -0,0 +1,2 @@ +tags: + integration: {} diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml b/wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml new file mode 100644 index 0000000..582cb3c --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/appspec.yml @@ -0,0 +1,16 @@ +version: 0.0 +os: linux +files: + - source: /vendor/ + destination: /home/ec2-user/serverpod/upload/vendor/ + - source: /wien_talks_server/ + destination: /home/ec2-user/serverpod/upload/wien_talks_server/ +hooks: + BeforeInstall: + - location: wien_talks_server/deploy/aws/scripts/install_dependencies + timeout: 300 + runas: root + ApplicationStart: + - location: wien_talks_server/deploy/aws/scripts/start_server + timeout: 300 + runas: root diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies b/wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies new file mode 100644 index 0000000..041de4c --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/install_dependencies @@ -0,0 +1,47 @@ +#!/bin/bash +set -e # Exit on any error + +# Variables for configuration +DART_VERSION=3.5.1 +USERNAME=ec2-user +WORKDIR=/home/$USERNAME +DART_INSTALL_DIR="/usr/lib/dart$DART_VERSION" + +# Uncomment the following lines if migrating from an older serverpod CLI version +# if [ -f "/etc/profile.d/script.sh" ]; then +# sudo rm /etc/profile.d/script.sh +# fi + +# Install the specified Dart version if not already installed +if [ ! -d "$DART_INSTALL_DIR" ]; then + echo "Installing Dart $DART_VERSION..." + wget -q https://storage.googleapis.com/dart-archive/channels/stable/release/$DART_VERSION/sdk/dartsdk-linux-x64-release.zip -P /tmp + cd /tmp || exit + unzip -q dartsdk-linux-x64-release.zip + sudo mv dart-sdk/ "$DART_INSTALL_DIR" + sudo chmod -R 755 "$DART_INSTALL_DIR" + rm -rf dartsdk-linux-x64-release.zip +fi + +# Make symlink for Dart binaries +sudo ln -sf "$DART_INSTALL_DIR/bin/dart" /usr/local/bin/dart + +# Write the systemd unit file +cat > /lib/systemd/system/serverpod.service << EOF +[Unit] +Description=Serverpod server +After=network.target +Wants=network-online.target + +[Service] +User=$USERNAME +WorkingDirectory=$WORKDIR +ExecStart=$WORKDIR/serverpod/active/wien_talks_server/deploy/aws/scripts/run_serverpod +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +# Reload systemd configuration +systemctl daemon-reload diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod b/wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod new file mode 100644 index 0000000..455383d --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/run_serverpod @@ -0,0 +1,5 @@ +#!/bin/bash +RUNMODE=$(cat /home/ec2-user/runmode) +SERVER_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) +cd /home/ec2-user/serverpod/active/wien_talks_server +dart --old_gen_heap_size=0 run bin/main.dill --mode $RUNMODE --server-id $SERVER_ID > /home/ec2-user/serverpod.log 2> /home/ec2-user/serverpod.err diff --git a/wien_talks/wien_talks_server/deploy/aws/scripts/start_server b/wien_talks/wien_talks_server/deploy/aws/scripts/start_server new file mode 100644 index 0000000..517a411 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/scripts/start_server @@ -0,0 +1,19 @@ +#!/bin/bash + +# Make sure permissions are correct for the serverpod directory +chown -R ec2-user:ec2-user /home/ec2-user/serverpod + +# Run pub get as ec2-user +cd /home/ec2-user/serverpod/upload/wien_talks_server/ +sudo -u ec2-user dart pub get + +# Set correct permissions for start script +chmod 755 deploy/aws/scripts/run_serverpod + +# Stop the server if it's running, copy files, and restart +systemctl stop serverpod + +rm -rf /home/ec2-user/serverpod/active/ +cp -rp /home/ec2-user/serverpod/upload/ /home/ec2-user/serverpod/active/ + +systemctl start serverpod diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf new file mode 100644 index 0000000..ac78a84 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers-staging.tf @@ -0,0 +1,143 @@ +# API load balancer setup + +resource "aws_lb" "serverpod_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-serverpod-staging" + internal = false + load_balancer_type = "application" + security_groups = [aws_security_group.api.id] + subnets = module.vpc.public_subnets +} + +resource "aws_lb_listener" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + load_balancer_arn = aws_lb.serverpod_staging[0].arn + port = "443" + protocol = "HTTPS" + certificate_arn = var.certificate_arn + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.api_staging[0].arn + } +} + +resource "aws_lb_target_group" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-api-staging" + port = 8080 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_lb_listener_rule" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + listener_arn = aws_lb_listener.api_staging[0].arn + priority = 100 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.api_staging[0].arn + } + + condition { + host_header { + values = ["${var.subdomain_api_staging}.${var.top_domain}"] + } + } +} + +resource "aws_autoscaling_attachment" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + autoscaling_group_name = aws_autoscaling_group.staging[0].id + lb_target_group_arn = aws_lb_target_group.api_staging[0].arn +} + +resource "aws_route53_record" "api_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_api_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod_staging[0].dns_name}"] +} + +resource "aws_lb_target_group" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-insights-staging" + port = 8081 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + autoscaling_group_name = aws_autoscaling_group.staging[0].id + lb_target_group_arn = aws_lb_target_group.insights_staging[0].arn +} + +resource "aws_lb_listener_rule" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + listener_arn = aws_lb_listener.api_staging[0].arn + priority = 99 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.insights_staging[0].arn + } + + condition { + host_header { + values = ["${var.subdomain_insights_staging}.${var.top_domain}"] + } + } +} + +resource "aws_route53_record" "insights_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_insights_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod_staging[0].dns_name}"] +} + +resource "aws_lb_target_group" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + name = "${var.project_name}-web-staging" + port = 8082 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + autoscaling_group_name = aws_autoscaling_group.staging[0].id + lb_target_group_arn = aws_lb_target_group.web_staging[0].arn +} + + +resource "aws_lb_listener" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + load_balancer_arn = aws_lb.serverpod_staging[0].arn + port = "80" + protocol = "HTTP" + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.web_staging[0].arn + } +} diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf new file mode 100644 index 0000000..774bab0 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/balancers.tf @@ -0,0 +1,148 @@ +# API load balancer setup + +resource "aws_lb" "serverpod" { + name = "${var.project_name}-serverpod" + internal = false + load_balancer_type = "application" + security_groups = [aws_security_group.api.id] + subnets = module.vpc.public_subnets +} + +resource "aws_security_group" "api" { + name = "${var.project_name}-api" + ingress { + from_port = 443 + to_port = 443 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + ingress { + from_port = 80 + to_port = 80 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + vpc_id = module.vpc.vpc_id +} + +resource "aws_lb_listener" "api" { + load_balancer_arn = aws_lb.serverpod.arn + port = "443" + protocol = "HTTPS" + certificate_arn = var.certificate_arn + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.api.arn + } +} + +resource "aws_lb_target_group" "api" { + name = "${var.project_name}-api" + port = 8080 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_lb_listener_rule" "api" { + listener_arn = aws_lb_listener.api.arn + priority = 100 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.api.arn + } + + condition { + host_header { + values = ["${var.subdomain_api}.${var.top_domain}"] + } + } +} + +resource "aws_autoscaling_attachment" "api" { + autoscaling_group_name = aws_autoscaling_group.serverpod.id + lb_target_group_arn = aws_lb_target_group.api.arn +} + +resource "aws_route53_record" "api" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_api}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod.dns_name}"] +} + +# Insights load balancer rules + +resource "aws_lb_target_group" "insights" { + name = "${var.project_name}-insights" + port = 8081 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "insights" { + autoscaling_group_name = aws_autoscaling_group.serverpod.id + lb_target_group_arn = aws_lb_target_group.insights.arn +} + +resource "aws_lb_listener_rule" "insights" { + listener_arn = aws_lb_listener.api.arn + priority = 99 + + action { + type = "forward" + target_group_arn = aws_lb_target_group.insights.arn + } + + condition { + host_header { + values = ["${var.subdomain_insights}.${var.top_domain}"] + } + } +} + +resource "aws_route53_record" "insights" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_insights}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_lb.serverpod.dns_name}"] +} + +# Web server load balancer rules + +resource "aws_lb_target_group" "web" { + name = "${var.project_name}-web" + port = 8082 + protocol = "HTTP" + vpc_id = module.vpc.vpc_id +} + +resource "aws_autoscaling_attachment" "web" { + autoscaling_group_name = aws_autoscaling_group.serverpod.id + lb_target_group_arn = aws_lb_target_group.web.arn +} + +resource "aws_lb_listener" "web" { + load_balancer_arn = aws_lb.serverpod.arn + port = "80" + protocol = "HTTP" + # certificate_arn = var.certificate_arn + + default_action { + type = "forward" + target_group_arn = aws_lb_target_group.web.arn + } +} + diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf new file mode 100644 index 0000000..d746378 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web-staging.tf @@ -0,0 +1,65 @@ +locals { + alb_origin_id_staging = "${var.project_name}-web-staging" +} + +resource "aws_cloudfront_distribution" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + origin { + origin_id = local.alb_origin_id_staging + domain_name = aws_lb.serverpod_staging[0].dns_name + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "http-only" + origin_ssl_protocols = ["SSLv3"] + } + } + enabled = true + + aliases = ["${var.subdomain_web_staging}.${var.top_domain}"] + + default_cache_behavior { + allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] + cached_methods = ["HEAD", "GET"] + target_origin_id = local.alb_origin_id_staging + + forwarded_values { + query_string = true + + cookies { + forward = "all" + } + + headers = ["*"] + } + + viewer_protocol_policy = "redirect-to-https" + min_ttl = 0 + default_ttl = 0 + max_ttl = 0 + } + + price_class = "PriceClass_100" + + viewer_certificate { + acm_certificate_arn = var.cloudfront_certificate_arn + ssl_support_method = "sni-only" + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } +} + +resource "aws_route53_record" "web_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_web_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_cloudfront_distribution.web_staging[0].domain_name}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf new file mode 100644 index 0000000..340685a --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/cloudfront-web.tf @@ -0,0 +1,73 @@ +locals { + alb_origin_id = "${var.project_name}-web" +} + +resource "aws_cloudfront_distribution" "web" { + origin { + origin_id = local.alb_origin_id + domain_name = aws_lb.serverpod.dns_name + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "http-only" + origin_ssl_protocols = ["SSLv3"] + } + } + enabled = true + + aliases = ["${var.subdomain_web}.${var.top_domain}", "${var.top_domain}"] + + default_cache_behavior { + allowed_methods = ["HEAD", "DELETE", "POST", "GET", "OPTIONS", "PUT", "PATCH"] + cached_methods = ["HEAD", "GET"] + target_origin_id = local.alb_origin_id + + forwarded_values { + query_string = true + + cookies { + forward = "all" + } + + headers = ["*"] + } + + viewer_protocol_policy = "redirect-to-https" + min_ttl = 0 + default_ttl = 0 + max_ttl = 0 + } + + price_class = "PriceClass_100" + + viewer_certificate { + acm_certificate_arn = var.cloudfront_certificate_arn + ssl_support_method = "sni-only" + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } +} + +resource "aws_route53_record" "web" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_web}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_cloudfront_distribution.web.domain_name}"] +} + +resource "aws_route53_record" "web_top_domain" { + count = var.use_top_domain_for_web ? 1 : 0 + zone_id = var.hosted_zone_id + name = var.top_domain + type = "A" + alias { + name = aws_cloudfront_distribution.web.domain_name + zone_id = aws_cloudfront_distribution.web.hosted_zone_id + evaluate_target_health = false + } +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf new file mode 100644 index 0000000..2216a42 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/code-deploy.tf @@ -0,0 +1,98 @@ + +# Code deploy setup + +resource "aws_iam_instance_profile" "codedeploy_profile" { + name = "${var.project_name}-codedeploy-profile" + role = aws_iam_role.codedeploy_role.name +} + +resource "aws_iam_role" "codedeploy_role" { + name = "${var.project_name}-codedeploy-role" + + assume_role_policy = < AMI Catalog in your AWS console.) +# Note: For some regions the t2.micro is not available. If so, consult the AWS +# documentation to find another instance type that suits your needs. +instance_type = "t2.micro" +instance_ami = "ami-0ca285d4c2cda3300" +autoscaling_min_size = 1 +autoscaling_max_size = 1 +autoscaling_desired_capacity = 1 + + +# Setup an additional server cluster and associated load balancers for staging. +# By default, the staging server uses the same database and Redis setup as the +# production server. If you want to change this behavior you will need add +# and edit the Terraform files. +# Note: By turning this feature on, the server setup will no longer fit within +# the AWS free tier as it will use multiple server instances and load balancers. +enable_staging_server = false + +staging_instance_type = "t2.micro" +staging_autoscaling_min_size = 1 +staging_autoscaling_max_size = 1 +staging_autoscaling_desired_capacity = 1 + +# The deployment bucket name needs to be unique and can only contain lower case +# letters and dashes (no underscored allowed). +deployment_bucket_name = "wien-talks-deployment-6559518" +public_storage_bucket_name = "wien-talks-public-storage-6559518" +private_storage_bucket_name = "wien-talks-private-storage-6559518" +public_storage_bucket_name_staging = "wien-talks-public-storage-staging-6559518" +private_storage_bucket_name_staging = "wien-talks-private-storage-staging-6559518" \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/database.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/database.tf new file mode 100644 index 0000000..07db31b --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/database.tf @@ -0,0 +1,65 @@ +resource "aws_db_instance" "postgres" { + identifier = var.project_name + allocated_storage = 10 + engine = "postgres" + engine_version = "16.3" + instance_class = "db.t3.micro" + db_name = "serverpod" + username = "postgres" + password = var.DATABASE_PASSWORD_PRODUCTION + skip_final_snapshot = true + vpc_security_group_ids = [ + aws_security_group.database.id + ] + publicly_accessible = true + db_subnet_group_name = module.vpc.database_subnet_group_name +} + +resource "aws_route53_record" "database" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_database}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_db_instance.postgres.address}"] +} + +# Makes the database accessible from anywhere. +resource "aws_security_group" "database" { + name = "${var.project_name}-database" + ingress { + from_port = 5432 + to_port = 5432 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } +} + +# Staging +resource "aws_db_instance" "postgres_staging" { + count = var.enable_staging_server ? 1 : 0 + + identifier = "${var.project_name}-staging" + allocated_storage = 10 + engine = "postgres" + engine_version = "16.3" + instance_class = "db.t3.micro" + db_name = "serverpod" + username = "postgres" + password = var.DATABASE_PASSWORD_STAGING + skip_final_snapshot = true + vpc_security_group_ids = [ + aws_security_group.database.id + ] + publicly_accessible = true + db_subnet_group_name = module.vpc.database_subnet_group_name +} + +resource "aws_route53_record" "database_staging" { + count = var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_database_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_db_instance.postgres_staging[0].address}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh b/wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh new file mode 100644 index 0000000..139eabc --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/init-script.sh @@ -0,0 +1,24 @@ +#!/bin/bash +echo "Update yum packages" +yum update -y + +# Install yum packages +echo "Installing ruby" +yum install ruby -y +echo "Installing wget" +yum install wget -y + +# Install CodeDeploy agent +echo "Installing CodeDeploy agent" +cd /home/ec2-user +wget https://aws-codedeploy-us-west-2.s3.us-west-2.amazonaws.com/latest/install +chmod +x ./install +./install auto +rm install + +# Set runmode +echo "Setting runmode" +echo ${runmode} > /home/ec2-user/runmode +chown ec2-user:ec2-user /home/ec2-user/runmode + +echo "Setup done" diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf new file mode 100644 index 0000000..59bdd1c --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/instances.tf @@ -0,0 +1,102 @@ + +# EC2 auto scaling cluster and security groups + +data "aws_availability_zones" "available" { + state = "available" +} + +# TODO: Fix? +data "aws_ami" "amazon-linux" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-ebs"] + } +} + +resource "aws_launch_configuration" "serverpod" { + name_prefix = "${var.project_name}-" + image_id = var.instance_ami + # image_id = data.aws_ami.amazon-linux.id + instance_type = var.instance_type + user_data = templatefile("init-script.sh", { runmode = "production" }) + + security_groups = [ + aws_security_group.serverpod.id, + aws_security_group.ssh.id + ] + + iam_instance_profile = aws_iam_instance_profile.codedeploy_profile.name + + lifecycle { + create_before_destroy = true + } +} + +resource "aws_autoscaling_group" "serverpod" { + min_size = var.autoscaling_min_size + max_size = var.autoscaling_max_size + desired_capacity = var.autoscaling_desired_capacity + launch_configuration = aws_launch_configuration.serverpod.name + vpc_zone_identifier = module.vpc.public_subnets + + target_group_arns = [ + aws_lb_target_group.api.arn, + aws_lb_target_group.insights.arn, + aws_lb_target_group.web.arn + ] + + tag { + key = "Name" + value = "${var.project_name}-serverpod" + propagate_at_launch = true + } + + tag { + key = "CodeDeploy" + value = var.project_name + propagate_at_launch = true + } +} + +resource "aws_security_group" "serverpod" { + name = "${var.project_name}-serverpod" + + ingress { + from_port = 8080 + to_port = 8082 + protocol = "tcp" + security_groups = [aws_security_group.api.id] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + vpc_id = module.vpc.vpc_id +} + +resource "aws_security_group" "ssh" { + name = "${var.project_name}-ssh" + + ingress { + from_port = 22 + to_port = 22 + protocol = "tcp" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + vpc_id = module.vpc.vpc_id +} diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/main.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/main.tf new file mode 100644 index 0000000..224e436 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/main.tf @@ -0,0 +1,17 @@ +# Terraform and AWS setup + +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 4.13" + } + } + + required_version = ">= 1.1.9" +} + +provider "aws" { + # profile = "default" + region = var.aws_region +} diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf new file mode 100644 index 0000000..7c10d27 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/redis.tf @@ -0,0 +1,70 @@ +resource "aws_elasticache_cluster" "redis" { + count = var.enable_redis ? 1 : 0 + + cluster_id = var.project_name + engine = "redis" + node_type = "cache.t4g.micro" + num_cache_nodes = 1 + engine_version = "6.x" + port = 6379 + apply_immediately = true + security_group_ids = [aws_security_group.redis[0].id] + subnet_group_name = aws_elasticache_subnet_group.redis[0].name +} + +resource "aws_route53_record" "redis" { + count = var.enable_redis ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_redis}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_elasticache_cluster.redis[0].cache_nodes[0].address}"] +} + +# Makes Redis accessible from the serverpod only. +resource "aws_security_group" "redis" { + count = var.enable_redis ? 1 : 0 + + name = "${var.project_name}-redis" + ingress { + from_port = 6379 + to_port = 6379 + protocol = "tcp" + security_groups = [aws_security_group.serverpod.id] + } + + vpc_id = module.vpc.vpc_id +} + +resource "aws_elasticache_subnet_group" "redis" { + count = var.enable_redis ? 1 : 0 + + name = "${var.project_name}-subnet" + subnet_ids = module.vpc.public_subnets +} + +# Staging +resource "aws_elasticache_cluster" "redis_staging" { + count = var.enable_redis && var.enable_staging_server ? 1 : 0 + + cluster_id = var.project_name + engine = "redis" + node_type = "cache.t4g.micro" + num_cache_nodes = 1 + engine_version = "6.x" + port = 6379 + apply_immediately = true + security_group_ids = [aws_security_group.redis[0].id] + subnet_group_name = aws_elasticache_subnet_group.redis[0].name +} + +resource "aws_route53_record" "redis_staging" { + count = var.enable_redis && var.enable_staging_server ? 1 : 0 + + zone_id = var.hosted_zone_id + name = "${var.subdomain_redis_staging}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_elasticache_cluster.redis_staging[0].cache_nodes[0].address}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf new file mode 100644 index 0000000..11d0db2 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/staging.tf @@ -0,0 +1,57 @@ +resource "aws_launch_configuration" "staging" { + count = var.enable_staging_server ? 1 : 0 + + name_prefix = "${var.project_name}-staging-" + image_id = var.instance_ami + # image_id = data.aws_ami.amazon-linux.id + instance_type = var.staging_instance_type + user_data = templatefile("init-script.sh", { runmode = "staging" }) + + security_groups = [ + aws_security_group.serverpod.id, + aws_security_group.ssh.id + ] + + iam_instance_profile = aws_iam_instance_profile.codedeploy_profile.name + + lifecycle { + create_before_destroy = true + } +} + +resource "aws_autoscaling_group" "staging" { + count = var.enable_staging_server ? 1 : 0 + + min_size = var.staging_autoscaling_min_size + max_size = var.staging_autoscaling_max_size + desired_capacity = var.staging_autoscaling_desired_capacity + launch_configuration = aws_launch_configuration.staging[0].name + vpc_zone_identifier = module.vpc.public_subnets + + target_group_arns = [ + aws_lb_target_group.api_staging[0].arn, + aws_lb_target_group.insights_staging[0].arn, + aws_lb_target_group.web_staging[0].arn + ] + + tag { + key = "Name" + value = "${var.project_name}-serverpod-staging" + propagate_at_launch = true + } + + tag { + key = "CodeDeploy" + value = "${var.project_name}-staging" + propagate_at_launch = true + } +} + +resource "aws_codedeploy_deployment_group" "staging" { + count = var.enable_staging_server ? 1 : 0 + + app_name = aws_codedeploy_app.serverpod.name + deployment_group_name = "${var.project_name}-staging-group" + service_role_arn = aws_iam_role.codedeploy_role.arn + autoscaling_groups = [aws_autoscaling_group.staging[0].id] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf new file mode 100644 index 0000000..6f122c3 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/storage.tf @@ -0,0 +1,94 @@ +# S3 buckets +resource "aws_s3_bucket" "public_storage" { + bucket = var.public_storage_bucket_name + force_destroy = true + + tags = { + Name = "${var.project_name} public storage" + } +} + +resource "aws_s3_bucket_acl" "public_storage" { + bucket = aws_s3_bucket.public_storage.id + acl = "private" +} + +resource "aws_s3_bucket_ownership_controls" "public_storage" { + bucket = aws_s3_bucket.public_storage.id + rule { + object_ownership = "ObjectWriter" + } +} + +resource "aws_s3_bucket" "private_storage" { + bucket = var.private_storage_bucket_name + force_destroy = true + + tags = { + Name = "${var.project_name} private storage" + } +} + +resource "aws_s3_bucket_acl" "private_storage" { + bucket = aws_s3_bucket.private_storage.id + acl = "private" +} + +resource "aws_s3_bucket_ownership_controls" "private_storage" { + bucket = aws_s3_bucket.private_storage.id + rule { + object_ownership = "ObjectWriter" + } +} + +locals { + s3_origin_id = "${var.project_name}-storage" +} + +resource "aws_cloudfront_distribution" "public_storage" { + origin { + origin_id = local.s3_origin_id + domain_name = aws_s3_bucket.public_storage.bucket_regional_domain_name + } + enabled = true + + aliases = ["${var.subdomain_storage}.${var.top_domain}"] + + default_cache_behavior { + allowed_methods = ["GET", "HEAD"] + cached_methods = ["GET", "HEAD"] + target_origin_id = local.s3_origin_id + + forwarded_values { + query_string = false + cookies { + forward = "none" + } + } + viewer_protocol_policy = "redirect-to-https" + min_ttl = 0 + default_ttl = 3600 + max_ttl = 86400 + } + + price_class = "PriceClass_100" + + viewer_certificate { + acm_certificate_arn = var.cloudfront_certificate_arn + ssl_support_method = "sni-only" + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } +} + +resource "aws_route53_record" "public_storage" { + zone_id = var.hosted_zone_id + name = "${var.subdomain_storage}.${var.top_domain}" + type = "CNAME" + ttl = "300" + records = ["${aws_cloudfront_distribution.public_storage.domain_name}"] +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf new file mode 100644 index 0000000..545649f --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/variables.tf @@ -0,0 +1,198 @@ +# Project setup + +variable "project_name" { + description = "Name of your project" + type = string +} + +variable "aws_region" { + description = "The region to deploy the configuration to" + type = string +} + +variable "enable_redis" { + description = "Deploy a managed Redis server" + type = bool +} + +variable "enable_staging_server" { + description = "Deploy a staging server" + type = bool +} + +# Instance setup + +variable "instance_ami" { + description = "The ami used for the instance" + type = string +} + +variable "instance_type" { + description = "The type used for the instance" + type = string +} + +variable "autoscaling_min_size" { + description = "Minimum size for the autoscaling pool" + type = number +} + +variable "autoscaling_max_size" { + description = "Maximum size for the autoscaling pool" + type = number +} + +variable "autoscaling_desired_capacity" { + description = "Desired size for the autoscaling pool" + type = number +} + +# Staging instance setup + +variable "staging_instance_type" { + description = "The type used for the instance" + type = string +} + +variable "staging_autoscaling_min_size" { + description = "Minimum size for the autoscaling pool" + type = number +} + +variable "staging_autoscaling_max_size" { + description = "Maximum size for the autoscaling pool" + type = number +} + +variable "staging_autoscaling_desired_capacity" { + description = "Desired size for the autoscaling pool" + type = number +} + +# Deployment + +variable "deployment_bucket_name" { + description = "Name of S3 bucket used for deployments" + type = string +} + +# Domains and certificates + +variable "hosted_zone_id" { + description = "The id of your hosted zone in Route 53" + type = string +} + +variable "certificate_arn" { + description = "Wildcard certificate for the top domain" + type = string +} + +variable "cloudfront_certificate_arn" { + description = "Certificate for use with Cloudfront, must be in us-east-1 region." + type = string +} + +variable "top_domain" { + description = "The domain name for use with Insights api" + type = string +} + +variable "subdomain_database" { + description = "The domain name for use with the database" + type = string +} + +variable "subdomain_redis" { + description = "The domain name for use with Redis" + type = string +} + +variable "subdomain_api" { + description = "The domain name for use with api" + type = string +} + +variable "subdomain_insights" { + description = "The domain name for use with Insights api" + type = string +} + +variable "subdomain_web" { + description = "The domain name for use with the web server" + type = string +} + +variable "subdomain_storage" { + description = "The domain name for use with public storage" + type = string +} + +variable "subdomain_database_staging" { + description = "The domain name for use with the database" + type = string +} + +variable "subdomain_redis_staging" { + description = "The domain name for use with Redis" + type = string +} + +variable "subdomain_api_staging" { + description = "The domain name for use by api staging" + type = string +} + +variable "subdomain_insights_staging" { + description = "The domain name for use by insights staging" + type = string +} + +variable "subdomain_web_staging" { + description = "The domain name for use by web server staging" + type = string +} + +variable "subdomain_storage_staging" { + description = "The domain name for use with public storage" + type = string +} + +variable "use_top_domain_for_web" { + description = "Set to true if you want to point the top domain to the web server" + type = bool +} + +# Storage + +variable "public_storage_bucket_name" { + description = "Name of S3 bucket used for public storage" + type = string +} + +variable "private_storage_bucket_name" { + description = "Name of S3 bucket used for private storage" + type = string +} + +variable "public_storage_bucket_name_staging" { + description = "Name of S3 bucket used for public storage" + type = string +} + +variable "private_storage_bucket_name_staging" { + description = "Name of S3 bucket used for private storage" + type = string +} + +# Database + +variable "DATABASE_PASSWORD_PRODUCTION" { + description = "The production database password, you can find it in the config/passwords.yaml file." + type = string +} + +variable "DATABASE_PASSWORD_STAGING" { + description = "The staging database password, you can find it in the config/passwords.yaml file (no need to specify if you aren't deploying a staging environment)." + type = string +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf b/wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf new file mode 100644 index 0000000..b6855ca --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/aws/terraform/vpc.tf @@ -0,0 +1,18 @@ +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "2.77.0" + + name = "${var.project_name}-vpc" + cidr = "10.0.0.0/16" + + azs = data.aws_availability_zones.available.names + public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] + enable_dns_hostnames = true + enable_dns_support = true + + # create_database_subnet_group = true + # create_database_subnet_route_table = true + # create_database_internet_gateway_route = true + + # create_elasticache_subnet_group = true +} diff --git a/wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh b/wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh new file mode 100644 index 0000000..3ea6078 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/console_gcr/cloud-run-deploy.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# These are the variables that need to be set to be able to deploy to cloud run. +# You can find the values in the Google Cloud Console. +DATABASE_INSTANCE_CONNECTION_NAME="" +SERVICE_ACCOUNT="" + +# Optionally configure the region and runmode (staging is also viable). +REGION="us-central1" +RUNMODE="production" + + +# Check that we are running the script from the correct directory. +if [ ! -f config/production.yaml ]; then + echo "Run this script from the root of your server directory (e.g., mypod/mypod_server)." + exit 1 +fi + + +# Deploy the API server. +echo "Deploying API server..." + +gcloud run deploy serverpod-api \ + --source=. \ + --region=$REGION \ + --platform=managed \ + --service-account=$SERVICE_ACCOUNT \ + --port=8080 \ + --set-cloudsql-instances=$DATABASE_INSTANCE_CONNECTION_NAME \ + --execution-environment=gen2 \ + --set-env-vars="runmode=$RUNMODE" \ + --set-env-vars="role=serverless" \ + --allow-unauthenticated + + +# Deploy the Insights server. This is used by the Serverpod Insights app. It +# can provide run time information and logs from the API server. +echo "Deploying Insights server..." + +gcloud run deploy serverpod-insights \ + --source=. \ + --region=$REGION \ + --platform=managed \ + --service-account=$SERVICE_ACCOUNT \ + --port=8081 \ + --set-cloudsql-instances=$DATABASE_INSTANCE_CONNECTION_NAME \ + --execution-environment=gen2 \ + --set-env-vars="runmode=$RUNMODE" \ + --set-env-vars="role=serverless" \ + --allow-unauthenticated diff --git a/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars new file mode 100644 index 0000000..dc2b0e1 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/config.auto.tfvars @@ -0,0 +1,23 @@ +# This is the main configuration file. You can deploy your Serverpod by only +# doing changes to this file. Serverpod uses a minimal setup by default, but +# you can edit the main.tf file to choose higher tiers for database and your +# managed instances or enable additional services like Redis. +# +# You can find complete setup instructions at: +# https://docs.serverpod.dev/ + +# The Project ID from the Google Cloud Console. +project = "" + +# The service account email address authorized by your Google Cloud Console. +service_account_email = "" + +# The name of your DNS zone. +dns_managed_zone = "" + +# The top domain of your DNS zone. e.g. "examplepod.com" +top_domain = "" + +# The region and zone to use for the deployment. Default values work. +region = "us-central1" +zone = "us-central1-c" diff --git a/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf new file mode 100644 index 0000000..34f1928 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/main.tf @@ -0,0 +1,95 @@ +# Set up and configure Terraform and the Google Cloud provider. +terraform { + required_providers { + google = { + source = "hashicorp/google" + version = "4.51.0" + } + } +} + +provider "google" { + credentials = file("credentials.json") + + project = var.project + region = var.region + zone = var.zone +} + +# Add a Serverpod module configured for production. Full documentation on all +# options is available at: +# https://github.com/serverpod/terraform-google-serverpod-cloud-engine + +module "serverpod_production" { + # References the Serverpod module from GitHub. + source = "github.com/serverpod/terraform-google-serverpod-cloud-engine?ref=stable-1.1" + + # Required parameters. + project = var.project + service_account_email = var.service_account_email + + runmode = "production" + + region = var.region + zone = var.zone + + dns_managed_zone = var.dns_managed_zone + top_domain = var.top_domain + + # Size of the auto scaling group. + autoscaling_min_size = 1 + autoscaling_max_size = 2 + + # Password for the production database. + database_password = var.DATABASE_PASSWORD_PRODUCTION + + # Adds Cloud Storage buckets for file uploads. + enable_storage = true + + # Adds Redis for caching and communication between servers. + enable_redis = false + + # Makes it possible to SSH into the individual server instances. + enable_ssh = true +} + + +# If you want to set up a staging environment, you can add a second module +# configured for staging. Just uncomment the following code and change the +# parameters as needed (default options should work too). + +# module "serverpod_staging" { +# # References the Serverpod module from GitHub. +# source = "github.com/serverpod/terraform-google-serverpod-cloud-engine?ref=stable-1.1" + +# # Required parameters. +# project = var.project +# service_account_email = var.service_account_email + +# runmode = "staging" + +# region = var.region +# zone = var.zone + +# dns_managed_zone = var.dns_managed_zone +# top_domain = var.top_domain + +# # Prefix for the staging, added to all subdomains. +# subdomain_prefix = "staging-" + +# # Size of the auto scaling group. +# autoscaling_min_size = 1 +# autoscaling_max_size = 2 + +# # Password for the production database. +# database_password = var.DATABASE_PASSWORD_STAGING + +# # Adds Cloud Storage buckets for file uploads. +# enable_storage = true + +# # Adds Redis for caching and communication between servers. +# enable_redis = false + +# # Makes it possible to SSH into the individual server instances. +# enable_ssh = true +# } diff --git a/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf new file mode 100644 index 0000000..85d5075 --- /dev/null +++ b/wien_talks/wien_talks_server/deploy/gcp/terraform_gce/variables.tf @@ -0,0 +1,39 @@ +# Project setup. + +variable "project" { + type = string +} + +variable "service_account_email" { + type = string +} + +variable "dns_managed_zone" { + type = string +} + +variable "top_domain" { + type = string +} + +variable "region" { + type = string + default = "us-central1" +} + +variable "zone" { + type = string + default = "us-central1-c" +} + +# Database + +variable "DATABASE_PASSWORD_PRODUCTION" { + description = "The production database password, you can find it in the config/passwords.yaml file." + type = string +} + +variable "DATABASE_PASSWORD_STAGING" { + description = "The staging database password, you can find it in the config/passwords.yaml file (no need to specify if you aren't deploying a staging environment)." + type = string +} diff --git a/wien_talks/wien_talks_server/docker-compose.deploy.yaml b/wien_talks/wien_talks_server/docker-compose.deploy.yaml new file mode 100644 index 0000000..9847ee1 --- /dev/null +++ b/wien_talks/wien_talks_server/docker-compose.deploy.yaml @@ -0,0 +1,69 @@ +networks: + docker-net: + name: docker-net + external: true + backend: + name: backend + driver: bridge + external: false + +services: + postgres: + image: postgres:16-trixie + container_name: postgres + env_file: + - path: env.d/postgres.env + required: true + volumes: + - db:/var/lib/postgresql/data + restart: always + networks: + - backend + ports: + - "127.0.0.1:5432:5432" + + server: + depends_on: + - postgres + build: + context: ./ + image: wien-talks + command: [ + "--mode", + "production", + "--server-id", + "default", + "--logging", + "normal", + "--role", + "monolith", + "--apply-migrations", + ] + env_file: + - path: env.d/server.env + required: true + restart: always + networks: + - docker-net + - backend + labels: + - "traefik.enable=true" + - "traefik.http.routers.wien-talks-api.rule=Host(`${SERVERPOD_API_SERVER_PUBLIC_HOST}`)" + - "traefik.http.routers.wien-talks-api.entrypoints=secure" + - "traefik.http.routers.wien-talks-api.service=wien-talks-api-service" + - "traefik.http.services.wien-talks-api-service.loadbalancer.server.port=${SERVERPOD_API_SERVER_PORT}" + + - "traefik.http.routers.wien-talks-insights.rule=Host(`${SERVERPOD_INSIGHTS_SERVER_PUBLIC_HOST}`)" + - "traefik.http.routers.wien-talks-insights.entrypoints=secure" + - "traefik.http.routers.wien-talks-insights.service=wien-talks-insights-service" + - "traefik.http.services.wien-talks-insights-service.loadbalancer.server.port=${SERVERPOD_INSIGHTS_SERVER_PORT}" + + - "traefik.http.routers.wien-talks-web.rule=Host(`${SERVERPOD_WEB_SERVER_PUBLIC_HOST}`)" + - "traefik.http.routers.wien-talks-web.entrypoints=secure" + - "traefik.http.routers.wien-talks-web.service=wien-talks-web-service" + - "traefik.http.services.wien-talks-web-service.loadbalancer.server.port=${SERVERPOD_WEB_SERVER_PORT}" + - "traefik.docker.network=docker-net" + +volumes: + db: + diff --git a/wien_talks/wien_talks_server/docker-compose.local.yaml b/wien_talks/wien_talks_server/docker-compose.local.yaml new file mode 100644 index 0000000..730d41c --- /dev/null +++ b/wien_talks/wien_talks_server/docker-compose.local.yaml @@ -0,0 +1,16 @@ +services: + postgres: + image: postgres:16-trixie + container_name: postgres-dev + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + volumes: + - db-local:/var/lib/postgresql/data + restart: unless-stopped + ports: + - "8090:5432" + +volumes: + db-local: diff --git a/wien_talks/wien_talks_server/env.d/postgres.env.template b/wien_talks/wien_talks_server/env.d/postgres.env.template new file mode 100644 index 0000000..500b878 --- /dev/null +++ b/wien_talks/wien_talks_server/env.d/postgres.env.template @@ -0,0 +1,3 @@ +POSTGRES_USER=postgres +POSTGRES_PASSWORD=sergtsop +POSTGRES_DB=wien_talks diff --git a/wien_talks/wien_talks_server/env.d/server.env.template b/wien_talks/wien_talks_server/env.d/server.env.template new file mode 100644 index 0000000..f2f644d --- /dev/null +++ b/wien_talks/wien_talks_server/env.d/server.env.template @@ -0,0 +1,20 @@ +SERVERPOD_API_SERVER_PORT=8080 +SERVERPOD_API_SERVER_PUBLIC_HOST=localhost +SERVERPOD_API_SERVER_PUBLIC_PORT +SERVERPOD_API_SERVER_PUBLIC_SCHEME +SERVERPOD_DATABASE_HOST=postgres +SERVERPOD_DATABASE_IS_UNIX_SOCKET +SERVERPOD_DATABASE_NAME=wien_talks +SERVERPOD_DATABASE_PASSWORD=${POSTGRES_PASSWORD} +SERVERPOD_DATABASE_PORT=5432 +SERVERPOD_DATABASE_REQUIRE_SSL=false +SERVERPOD_DATABASE_USER=postgres +SERVERPOD_INSIGHTS_SERVER_PORT=8081 +SERVERPOD_INSIGHTS_SERVER_PUBLIC_HOST=localhost +SERVERPOD_INSIGHTS_SERVER_PUBLIC_SCHEME +SERVERPOD_MAX_REQUEST_SIZE +SERVERPOD_SERVICE_SECRET +SERVERPOD_WEB_SERVER_PORT=8082 +SERVERPOD_WEB_SERVER_PUBLIC_HOST=localhost +SERVERPOD_WEB_SERVER_PUBLIC_PORT +SERVERPOD_WEB_SERVER_PUBLIC_SCHEME diff --git a/wien_talks/wien_talks_server/lib/server.dart b/wien_talks/wien_talks_server/lib/server.dart new file mode 100644 index 0000000..f324003 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/server.dart @@ -0,0 +1,43 @@ +// This is the starting point of your Serverpod server. In most cases, you will +// only need to make additions to this file if you add future calls, are +// configuring Relic (Serverpod's web-server), or need custom setup work. + +import 'package:serverpod/serverpod.dart'; + +import 'src/generated/endpoints.dart'; +import 'src/generated/protocol.dart'; +import 'src/web/routes/root.dart'; + +void run(List args) async { + // Initialize Serverpod and connect it with your generated code. + final pod = Serverpod( + args, + Protocol(), + Endpoints(), + // authenticationHandler: authenticationHandler, + ); + + // Setup a default page at the web root. + pod.webServer.addRoute(RouteRoot(), '/'); + pod.webServer.addRoute(RouteRoot(), '/index.html'); + // Serve all files in the /static directory. + pod.webServer.addRoute( + RouteStaticDirectory(serverDirectory: 'static', basePath: '/'), + '/*', + ); + + // Start the server. + await pod.start(); + + // After starting the server, you can register future calls. Future calls are + // tasks that need to happen in the future, or independently of the request/ + // response cycle. For example, you can use future calls to send emails, or to + // schedule tasks to be executed at a later time. Future calls are executed in + // the background. Their schedule is persisted to the database, so you will + // not lose them if the server is restarted. + + // You can schedule future calls for a later time during startup. But you can + // also schedule them in any endpoint or webroute through the session object. + // there is also [futureCallAtTime] if you want to schedule a future call at a + // specific time. +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/create_quote.dart b/wien_talks/wien_talks_server/lib/src/generated/create_quote.dart new file mode 100644 index 0000000..8b4a986 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/create_quote.dart @@ -0,0 +1,128 @@ +/* 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/serverpod.dart' as _i1; + +abstract class CreateQuoteRequest + implements _i1.SerializableModel, _i1.ProtocolSerialization { + CreateQuoteRequest._({ + required this.text, + this.authorName, + required this.lat, + required this.lng, + this.tags, + }); + + factory CreateQuoteRequest({ + required String text, + String? authorName, + required double lat, + required double lng, + List? tags, + }) = _CreateQuoteRequestImpl; + + factory CreateQuoteRequest.fromJson(Map jsonSerialization) { + return CreateQuoteRequest( + text: jsonSerialization['text'] as String, + authorName: jsonSerialization['authorName'] as String?, + lat: (jsonSerialization['lat'] as num).toDouble(), + lng: (jsonSerialization['lng'] as num).toDouble(), + tags: (jsonSerialization['tags'] as List?) + ?.map((e) => e as String) + .toList(), + ); + } + + String text; + + String? authorName; + + double lat; + + double lng; + + List? tags; + + /// Returns a shallow copy of this [CreateQuoteRequest] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + CreateQuoteRequest copyWith({ + String? text, + String? authorName, + double? lat, + double? lng, + List? tags, + }); + @override + Map toJson() { + return { + 'text': text, + if (authorName != null) 'authorName': authorName, + 'lat': lat, + 'lng': lng, + if (tags != null) 'tags': tags?.toJson(), + }; + } + + @override + Map toJsonForProtocol() { + return { + 'text': text, + if (authorName != null) 'authorName': authorName, + 'lat': lat, + 'lng': lng, + if (tags != null) 'tags': tags?.toJson(), + }; + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _CreateQuoteRequestImpl extends CreateQuoteRequest { + _CreateQuoteRequestImpl({ + required String text, + String? authorName, + required double lat, + required double lng, + List? tags, + }) : super._( + text: text, + authorName: authorName, + lat: lat, + lng: lng, + tags: tags, + ); + + /// Returns a shallow copy of this [CreateQuoteRequest] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + CreateQuoteRequest copyWith({ + String? text, + Object? authorName = _Undefined, + double? lat, + double? lng, + Object? tags = _Undefined, + }) { + return CreateQuoteRequest( + text: text ?? this.text, + authorName: authorName is String? ? authorName : this.authorName, + lat: lat ?? this.lat, + lng: lng ?? this.lng, + tags: tags is List? ? tags : this.tags?.map((e0) => e0).toList(), + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart b/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart new file mode 100644 index 0000000..9f25b92 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/endpoints.dart @@ -0,0 +1,183 @@ +/* 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/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 'package:serverpod_auth_server/serverpod_auth_server.dart' as _i7; + +class Endpoints extends _i1.EndpointDispatch { + @override + void initializeEndpoints(_i1.Server server) { + var endpoints = { + 'health': _i2.HealthEndpoint() + ..initialize( + server, + 'health', + null, + ), + 'quote': _i3.QuoteEndpoint() + ..initialize( + server, + 'quote', + null, + ), + 'votes': _i4.VotesEndpoint() + ..initialize( + server, + 'votes', + null, + ), + }; + connectors['health'] = _i1.EndpointConnector( + name: 'health', + endpoint: endpoints['health']!, + methodConnectors: { + 'ping': _i1.MethodConnector( + name: 'ping', + params: { + 'note': _i1.ParameterDescription( + name: 'note', + type: _i1.getType(), + nullable: true, + ) + }, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['health'] as _i2.HealthEndpoint).ping( + session, + note: params['note'], + ), + ), + 'all': _i1.MethodConnector( + name: 'all', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['health'] as _i2.HealthEndpoint).all(session), + ), + }, + ); + connectors['quote'] = _i1.EndpointConnector( + name: 'quote', + endpoint: endpoints['quote']!, + methodConnectors: { + 'createQuote': _i1.MethodConnector( + name: 'createQuote', + params: { + 'req': _i1.ParameterDescription( + name: 'req', + type: _i1.getType<_i5.CreateQuoteRequest>(), + nullable: false, + ) + }, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['quote'] as _i3.QuoteEndpoint).createQuote( + session, + params['req'], + ), + ), + 'updateQuote': _i1.MethodConnector( + name: 'updateQuote', + params: { + 'quote': _i1.ParameterDescription( + name: 'quote', + type: _i1.getType<_i6.Quote>(), + nullable: false, + ) + }, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['quote'] as _i3.QuoteEndpoint).updateQuote( + session, + params['quote'], + ), + ), + 'getAllQuotes': _i1.MethodConnector( + name: 'getAllQuotes', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['quote'] as _i3.QuoteEndpoint).getAllQuotes(session), + ), + 'streamAllQuotes': _i1.MethodStreamConnector( + name: 'streamAllQuotes', + params: { + 'limit': _i1.ParameterDescription( + name: 'limit', + type: _i1.getType(), + nullable: false, + ) + }, + streamParams: {}, + returnType: _i1.MethodStreamReturnType.streamType, + call: ( + _i1.Session session, + Map params, + Map streamParams, + ) => + (endpoints['quote'] as _i3.QuoteEndpoint).streamAllQuotes( + session, + limit: params['limit'], + ), + ), + }, + ); + connectors['votes'] = _i1.EndpointConnector( + name: 'votes', + endpoint: endpoints['votes']!, + methodConnectors: { + 'getAllVotes': _i1.MethodConnector( + name: 'getAllVotes', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['votes'] as _i4.VotesEndpoint).getAllVotes(session), + ), + 'createVote': _i1.MethodConnector( + name: 'createVote', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['votes'] as _i4.VotesEndpoint).createVote(session), + ), + 'sayHello': _i1.MethodConnector( + name: 'sayHello', + params: {}, + call: ( + _i1.Session session, + Map params, + ) async => + (endpoints['votes'] as _i4.VotesEndpoint).sayHello(session), + ), + }, + ); + modules['serverpod_auth'] = _i7.Endpoints()..initializeEndpoints(server); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/health.dart b/wien_talks/wien_talks_server/lib/src/generated/health.dart new file mode 100644 index 0000000..246819f --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/health.dart @@ -0,0 +1,401 @@ +/* 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/serverpod.dart' as _i1; + +abstract class Health implements _i1.TableRow, _i1.ProtocolSerialization { + Health._({ + this.id, + required this.createdAt, + this.note, + }); + + factory Health({ + int? id, + required DateTime createdAt, + String? note, + }) = _HealthImpl; + + factory Health.fromJson(Map jsonSerialization) { + return Health( + id: jsonSerialization['id'] as int?, + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + note: jsonSerialization['note'] as String?, + ); + } + + static final t = HealthTable(); + + static const db = HealthRepository._(); + + @override + int? id; + + DateTime createdAt; + + String? note; + + @override + _i1.Table get table => t; + + /// Returns a shallow copy of this [Health] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Health copyWith({ + int? id, + DateTime? createdAt, + String? note, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'createdAt': createdAt.toJson(), + if (note != null) 'note': note, + }; + } + + @override + Map toJsonForProtocol() { + return { + if (id != null) 'id': id, + 'createdAt': createdAt.toJson(), + if (note != null) 'note': note, + }; + } + + static HealthInclude include() { + return HealthInclude._(); + } + + static HealthIncludeList includeList({ + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + HealthInclude? include, + }) { + return HealthIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(Health.t), + orderDescending: orderDescending, + orderByList: orderByList?.call(Health.t), + include: include, + ); + } + + @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, + ); + } +} + +class HealthTable extends _i1.Table { + HealthTable({super.tableRelation}) : super(tableName: 'health') { + createdAt = _i1.ColumnDateTime( + 'createdAt', + this, + ); + note = _i1.ColumnString( + 'note', + this, + ); + } + + late final _i1.ColumnDateTime createdAt; + + late final _i1.ColumnString note; + + @override + List<_i1.Column> get columns => [ + id, + createdAt, + note, + ]; +} + +class HealthInclude extends _i1.IncludeObject { + HealthInclude._(); + + @override + Map get includes => {}; + + @override + _i1.Table get table => Health.t; +} + +class HealthIncludeList extends _i1.IncludeList { + HealthIncludeList._({ + _i1.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderDescending, + super.orderByList, + super.include, + }) { + super.where = where?.call(Health.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _i1.Table get table => Health.t; +} + +class HealthRepository { + const HealthRepository._(); + + /// Returns a list of [Health]s matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// ```dart + /// var persons = await Persons.db.find( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ); + /// ``` + Future> find( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + _i1.Transaction? transaction, + }) async { + return session.db.find( + where: where?.call(Health.t), + orderBy: orderBy?.call(Health.t), + orderByList: orderByList?.call(Health.t), + orderDescending: orderDescending, + limit: limit, + offset: offset, + transaction: transaction, + ); + } + + /// Returns the first matching [Health] matching the given query parameters. + /// + /// Use [where] to specify which items to include in the return value. + /// If none is specified, all items will be returned. + /// + /// To specify the order use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// [offset] defines how many items to skip, after which the next one will be picked. + /// + /// ```dart + /// var youngestPerson = await Persons.db.findFirstRow( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.age, + /// ); + /// ``` + Future findFirstRow( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + _i1.Transaction? transaction, + }) async { + return session.db.findFirstRow( + where: where?.call(Health.t), + orderBy: orderBy?.call(Health.t), + orderByList: orderByList?.call(Health.t), + orderDescending: orderDescending, + offset: offset, + transaction: transaction, + ); + } + + /// Finds a single [Health] by its [id] or null if no such row exists. + Future findById( + _i1.Session session, + int id, { + _i1.Transaction? transaction, + }) async { + return session.db.findById( + id, + transaction: transaction, + ); + } + + /// Inserts all [Health]s in the list and returns the inserted rows. + /// + /// The returned [Health]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails to + /// insert, none of the rows will be inserted. + Future> insert( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.db.insert( + rows, + transaction: transaction, + ); + } + + /// Inserts a single [Health] and returns the inserted row. + /// + /// The returned [Health] will have its `id` field set. + Future insertRow( + _i1.Session session, + Health row, { + _i1.Transaction? transaction, + }) async { + return session.db.insertRow( + row, + transaction: transaction, + ); + } + + /// Updates all [Health]s in the list and returns the updated rows. If + /// [columns] is provided, only those columns will be updated. Defaults to + /// all columns. + /// This is an atomic operation, meaning that if one of the rows fails to + /// update, none of the rows will be updated. + Future> update( + _i1.Session session, + List rows, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.db.update( + rows, + columns: columns?.call(Health.t), + transaction: transaction, + ); + } + + /// Updates a single [Health]. The row needs to have its id set. + /// Optionally, a list of [columns] can be provided to only update those + /// columns. Defaults to all columns. + Future updateRow( + _i1.Session session, + Health row, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.db.updateRow( + row, + columns: columns?.call(Health.t), + transaction: transaction, + ); + } + + /// Deletes all [Health]s in the list and returns the deleted rows. + /// This is an atomic operation, meaning that if one of the rows fail to + /// be deleted, none of the rows will be deleted. + Future> delete( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.db.delete( + rows, + transaction: transaction, + ); + } + + /// Deletes a single [Health]. + Future deleteRow( + _i1.Session session, + Health row, { + _i1.Transaction? transaction, + }) async { + return session.db.deleteRow( + row, + transaction: transaction, + ); + } + + /// Deletes all rows matching the [where] expression. + Future> deleteWhere( + _i1.Session session, { + required _i1.WhereExpressionBuilder where, + _i1.Transaction? transaction, + }) async { + return session.db.deleteWhere( + where: where(Health.t), + transaction: transaction, + ); + } + + /// Counts the number of rows matching the [where] expression. If omitted, + /// will return the count of all rows in the table. + Future count( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + _i1.Transaction? transaction, + }) async { + return session.db.count( + where: where?.call(Health.t), + limit: limit, + transaction: transaction, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/protocol.dart b/wien_talks/wien_talks_server/lib/src/generated/protocol.dart new file mode 100644 index 0000000..2cb9d22 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/protocol.dart @@ -0,0 +1,377 @@ +/* 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/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'; + +class Protocol extends _i1.SerializationManagerServer { + Protocol._(); + + factory Protocol() => _instance; + + 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', + schema: 'public', + module: 'wien_talks', + columns: [ + _i2.ColumnDefinition( + name: 'id', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int?', + columnDefault: 'nextval(\'quote_id_seq\'::regclass)', + ), + _i2.ColumnDefinition( + name: 'userId', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'text', + columnType: _i2.ColumnType.text, + isNullable: false, + dartType: 'String', + ), + _i2.ColumnDefinition( + name: 'authorName', + columnType: _i2.ColumnType.text, + isNullable: true, + dartType: 'String?', + ), + _i2.ColumnDefinition( + name: 'lat', + columnType: _i2.ColumnType.doublePrecision, + isNullable: false, + dartType: 'double', + ), + _i2.ColumnDefinition( + name: 'long', + columnType: _i2.ColumnType.doublePrecision, + isNullable: false, + dartType: 'double', + ), + _i2.ColumnDefinition( + name: 'createdAt', + columnType: _i2.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + _i2.ColumnDefinition( + name: 'visibility', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'upvotes', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'downvotes', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'tags', + columnType: _i2.ColumnType.json, + isNullable: true, + dartType: 'List?', + ), + ], + foreignKeys: [], + indexes: [ + _i2.IndexDefinition( + indexName: 'quote_pkey', + tableSpace: null, + elements: [ + _i2.IndexElementDefinition( + type: _i2.IndexElementDefinitionType.column, + definition: 'id', + ) + ], + type: 'btree', + isUnique: true, + isPrimary: true, + ) + ], + managed: true, + ), + _i2.TableDefinition( + name: 'vote', + dartName: 'Vote', + schema: 'public', + module: 'wien_talks', + columns: [ + _i2.ColumnDefinition( + name: 'id', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int?', + columnDefault: 'nextval(\'vote_id_seq\'::regclass)', + ), + _i2.ColumnDefinition( + name: 'userId', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'createdAt', + columnType: _i2.ColumnType.timestampWithoutTimeZone, + isNullable: false, + dartType: 'DateTime', + ), + _i2.ColumnDefinition( + name: 'quoteId', + columnType: _i2.ColumnType.bigint, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'upvote', + columnType: _i2.ColumnType.boolean, + isNullable: false, + dartType: 'bool', + ), + ], + foreignKeys: [], + indexes: [ + _i2.IndexDefinition( + indexName: 'vote_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, + ]; + + @override + T deserialize( + dynamic data, [ + Type? t, + ]) { + t ??= T; + if (t == _i4.CreateQuoteRequest) { + return _i4.CreateQuoteRequest.fromJson(data) as T; + } + if (t == _i5.Health) { + return _i5.Health.fromJson(data) as T; + } + if (t == _i6.Quote) { + return _i6.Quote.fromJson(data) as T; + } + if (t == _i7.Vote) { + return _i7.Vote.fromJson(data) as T; + } + if (t == _i1.getType<_i4.CreateQuoteRequest?>()) { + return (data != null ? _i4.CreateQuoteRequest.fromJson(data) : null) as T; + } + if (t == _i1.getType<_i5.Health?>()) { + return (data != null ? _i5.Health.fromJson(data) : null) as T; + } + if (t == _i1.getType<_i6.Quote?>()) { + return (data != null ? _i6.Quote.fromJson(data) : null) as T; + } + if (t == _i1.getType<_i7.Vote?>()) { + return (data != null ? _i7.Vote.fromJson(data) : null) as T; + } + if (t == _i1.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(e)).toList() + : null) as T; + } + if (t == _i1.getType?>()) { + return (data != null + ? (data as List).map((e) => deserialize(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<_i9.Quote>) { + return (data as List).map((e) => deserialize<_i9.Quote>(e)).toList() as T; + } + if (t == List<_i10.Vote>) { + return (data as List).map((e) => deserialize<_i10.Vote>(e)).toList() as T; + } + try { + return _i3.Protocol().deserialize(data, t); + } on _i1.DeserializationTypeNotFoundException catch (_) {} + try { + return _i2.Protocol().deserialize(data, t); + } on _i1.DeserializationTypeNotFoundException catch (_) {} + return super.deserialize(data, t); + } + + @override + String? getClassNameForObject(Object? data) { + String? className = super.getClassNameForObject(data); + if (className != null) return className; + if (data is _i4.CreateQuoteRequest) { + return 'CreateQuoteRequest'; + } + if (data is _i5.Health) { + return 'Health'; + } + if (data is _i6.Quote) { + return 'Quote'; + } + if (data is _i7.Vote) { + return 'Vote'; + } + className = _i2.Protocol().getClassNameForObject(data); + if (className != null) { + return 'serverpod.$className'; + } + className = _i3.Protocol().getClassNameForObject(data); + if (className != null) { + return 'serverpod_auth.$className'; + } + return null; + } + + @override + dynamic deserializeByClassName(Map data) { + var dataClassName = data['className']; + if (dataClassName is! String) { + return super.deserializeByClassName(data); + } + 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']); + } + if (dataClassName == 'Vote') { + return deserialize<_i7.Vote>(data['data']); + } + if (dataClassName.startsWith('serverpod.')) { + data['className'] = dataClassName.substring(10); + return _i2.Protocol().deserializeByClassName(data); + } + if (dataClassName.startsWith('serverpod_auth.')) { + data['className'] = dataClassName.substring(15); + return _i3.Protocol().deserializeByClassName(data); + } + return super.deserializeByClassName(data); + } + + @override + _i1.Table? getTableForType(Type t) { + { + var table = _i3.Protocol().getTableForType(t); + if (table != null) { + return table; + } + } + { + var table = _i2.Protocol().getTableForType(t); + if (table != null) { + return table; + } + } + switch (t) { + case _i5.Health: + return _i5.Health.t; + case _i6.Quote: + return _i6.Quote.t; + case _i7.Vote: + return _i7.Vote.t; + } + return null; + } + + @override + List<_i2.TableDefinition> getTargetTableDefinitions() => + targetTableDefinitions; + + @override + String getModuleName() => 'wien_talks'; +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml b/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml new file mode 100644 index 0000000..1183893 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/protocol.yaml @@ -0,0 +1,12 @@ +health: + - ping: + - all: +quote: + - createQuote: + - updateQuote: + - getAllQuotes: + - streamAllQuotes: +votes: + - getAllVotes: + - createVote: + - sayHello: diff --git a/wien_talks/wien_talks_server/lib/src/generated/quote.dart b/wien_talks/wien_talks_server/lib/src/generated/quote.dart new file mode 100644 index 0000000..f0f5606 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/quote.dart @@ -0,0 +1,555 @@ +/* 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/serverpod.dart' as _i1; + +abstract class Quote implements _i1.TableRow, _i1.ProtocolSerialization { + Quote._({ + this.id, + required this.userId, + required this.text, + this.authorName, + required this.lat, + required this.long, + required this.createdAt, + required this.visibility, + required this.upvotes, + required this.downvotes, + this.tags, + }); + + factory Quote({ + int? id, + required int userId, + required String text, + String? authorName, + required double lat, + required double long, + required DateTime createdAt, + required int visibility, + required int upvotes, + required int downvotes, + List? tags, + }) = _QuoteImpl; + + factory Quote.fromJson(Map jsonSerialization) { + return Quote( + id: jsonSerialization['id'] as int?, + userId: jsonSerialization['userId'] as int, + text: jsonSerialization['text'] as String, + authorName: jsonSerialization['authorName'] as String?, + lat: (jsonSerialization['lat'] as num).toDouble(), + long: (jsonSerialization['long'] as num).toDouble(), + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + visibility: jsonSerialization['visibility'] as int, + upvotes: jsonSerialization['upvotes'] as int, + downvotes: jsonSerialization['downvotes'] as int, + tags: (jsonSerialization['tags'] as List?) + ?.map((e) => e as String) + .toList(), + ); + } + + static final t = QuoteTable(); + + static const db = QuoteRepository._(); + + @override + int? id; + + int userId; + + String text; + + String? authorName; + + double lat; + + double long; + + DateTime createdAt; + + int visibility; + + int upvotes; + + int downvotes; + + List? tags; + + @override + _i1.Table get table => t; + + /// Returns a shallow copy of this [Quote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Quote copyWith({ + int? id, + int? userId, + String? text, + String? authorName, + double? lat, + double? long, + DateTime? createdAt, + int? visibility, + int? upvotes, + int? downvotes, + List? tags, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'userId': userId, + 'text': text, + if (authorName != null) 'authorName': authorName, + 'lat': lat, + 'long': long, + 'createdAt': createdAt.toJson(), + 'visibility': visibility, + 'upvotes': upvotes, + 'downvotes': downvotes, + if (tags != null) 'tags': tags?.toJson(), + }; + } + + @override + Map toJsonForProtocol() { + return { + if (id != null) 'id': id, + 'userId': userId, + 'text': text, + if (authorName != null) 'authorName': authorName, + 'lat': lat, + 'long': long, + 'createdAt': createdAt.toJson(), + 'visibility': visibility, + 'upvotes': upvotes, + 'downvotes': downvotes, + if (tags != null) 'tags': tags?.toJson(), + }; + } + + static QuoteInclude include() { + return QuoteInclude._(); + } + + static QuoteIncludeList includeList({ + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + QuoteInclude? include, + }) { + return QuoteIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(Quote.t), + orderDescending: orderDescending, + orderByList: orderByList?.call(Quote.t), + include: include, + ); + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _QuoteImpl extends Quote { + _QuoteImpl({ + int? id, + required int userId, + required String text, + String? authorName, + required double lat, + required double long, + required DateTime createdAt, + required int visibility, + required int upvotes, + required int downvotes, + List? tags, + }) : super._( + id: id, + userId: userId, + text: text, + authorName: authorName, + lat: lat, + long: long, + createdAt: createdAt, + visibility: visibility, + upvotes: upvotes, + downvotes: downvotes, + tags: tags, + ); + + /// Returns a shallow copy of this [Quote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Quote copyWith({ + Object? id = _Undefined, + int? userId, + String? text, + Object? authorName = _Undefined, + double? lat, + double? long, + DateTime? createdAt, + int? visibility, + int? upvotes, + int? downvotes, + Object? tags = _Undefined, + }) { + return Quote( + id: id is int? ? id : this.id, + userId: userId ?? this.userId, + text: text ?? this.text, + authorName: authorName is String? ? authorName : this.authorName, + lat: lat ?? this.lat, + long: long ?? this.long, + createdAt: createdAt ?? this.createdAt, + visibility: visibility ?? this.visibility, + upvotes: upvotes ?? this.upvotes, + downvotes: downvotes ?? this.downvotes, + tags: tags is List? ? tags : this.tags?.map((e0) => e0).toList(), + ); + } +} + +class QuoteTable extends _i1.Table { + QuoteTable({super.tableRelation}) : super(tableName: 'quote') { + userId = _i1.ColumnInt( + 'userId', + this, + ); + text = _i1.ColumnString( + 'text', + this, + ); + authorName = _i1.ColumnString( + 'authorName', + this, + ); + lat = _i1.ColumnDouble( + 'lat', + this, + ); + long = _i1.ColumnDouble( + 'long', + this, + ); + createdAt = _i1.ColumnDateTime( + 'createdAt', + this, + ); + visibility = _i1.ColumnInt( + 'visibility', + this, + ); + upvotes = _i1.ColumnInt( + 'upvotes', + this, + ); + downvotes = _i1.ColumnInt( + 'downvotes', + this, + ); + tags = _i1.ColumnSerializable( + 'tags', + this, + ); + } + + late final _i1.ColumnInt userId; + + late final _i1.ColumnString text; + + late final _i1.ColumnString authorName; + + late final _i1.ColumnDouble lat; + + late final _i1.ColumnDouble long; + + late final _i1.ColumnDateTime createdAt; + + late final _i1.ColumnInt visibility; + + late final _i1.ColumnInt upvotes; + + late final _i1.ColumnInt downvotes; + + late final _i1.ColumnSerializable tags; + + @override + List<_i1.Column> get columns => [ + id, + userId, + text, + authorName, + lat, + long, + createdAt, + visibility, + upvotes, + downvotes, + tags, + ]; +} + +class QuoteInclude extends _i1.IncludeObject { + QuoteInclude._(); + + @override + Map get includes => {}; + + @override + _i1.Table get table => Quote.t; +} + +class QuoteIncludeList extends _i1.IncludeList { + QuoteIncludeList._({ + _i1.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderDescending, + super.orderByList, + super.include, + }) { + super.where = where?.call(Quote.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _i1.Table get table => Quote.t; +} + +class QuoteRepository { + const QuoteRepository._(); + + /// Returns a list of [Quote]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. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// ```dart + /// var persons = await Persons.db.find( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ); + /// ``` + Future> find( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + _i1.Transaction? transaction, + }) async { + return session.db.find( + where: where?.call(Quote.t), + orderBy: orderBy?.call(Quote.t), + orderByList: orderByList?.call(Quote.t), + orderDescending: orderDescending, + limit: limit, + offset: offset, + transaction: transaction, + ); + } + + /// Returns the first matching [Quote] 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. + /// + /// To specify the order use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// [offset] defines how many items to skip, after which the next one will be picked. + /// + /// ```dart + /// var youngestPerson = await Persons.db.findFirstRow( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.age, + /// ); + /// ``` + Future findFirstRow( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + _i1.Transaction? transaction, + }) async { + return session.db.findFirstRow( + where: where?.call(Quote.t), + orderBy: orderBy?.call(Quote.t), + orderByList: orderByList?.call(Quote.t), + orderDescending: orderDescending, + offset: offset, + transaction: transaction, + ); + } + + /// Finds a single [Quote] by its [id] or null if no such row exists. + Future findById( + _i1.Session session, + int id, { + _i1.Transaction? transaction, + }) async { + return session.db.findById( + id, + transaction: transaction, + ); + } + + /// Inserts all [Quote]s in the list and returns the inserted rows. + /// + /// The returned [Quote]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails to + /// insert, none of the rows will be inserted. + Future> insert( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.db.insert( + rows, + transaction: transaction, + ); + } + + /// Inserts a single [Quote] and returns the inserted row. + /// + /// The returned [Quote] will have its `id` field set. + Future insertRow( + _i1.Session session, + Quote row, { + _i1.Transaction? transaction, + }) async { + return session.db.insertRow( + row, + transaction: transaction, + ); + } + + /// Updates all [Quote]s in the list and returns the updated rows. If + /// [columns] is provided, only those columns will be updated. Defaults to + /// all columns. + /// This is an atomic operation, meaning that if one of the rows fails to + /// update, none of the rows will be updated. + Future> update( + _i1.Session session, + List rows, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.db.update( + rows, + columns: columns?.call(Quote.t), + transaction: transaction, + ); + } + + /// Updates a single [Quote]. The row needs to have its id set. + /// Optionally, a list of [columns] can be provided to only update those + /// columns. Defaults to all columns. + Future updateRow( + _i1.Session session, + Quote row, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.db.updateRow( + row, + columns: columns?.call(Quote.t), + transaction: transaction, + ); + } + + /// Deletes all [Quote]s in the list and returns the deleted rows. + /// This is an atomic operation, meaning that if one of the rows fail to + /// be deleted, none of the rows will be deleted. + Future> delete( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.db.delete( + rows, + transaction: transaction, + ); + } + + /// Deletes a single [Quote]. + Future deleteRow( + _i1.Session session, + Quote row, { + _i1.Transaction? transaction, + }) async { + return session.db.deleteRow( + row, + transaction: transaction, + ); + } + + /// Deletes all rows matching the [where] expression. + Future> deleteWhere( + _i1.Session session, { + required _i1.WhereExpressionBuilder where, + _i1.Transaction? transaction, + }) async { + return session.db.deleteWhere( + where: where(Quote.t), + transaction: transaction, + ); + } + + /// Counts the number of rows matching the [where] expression. If omitted, + /// will return the count of all rows in the table. + Future count( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + _i1.Transaction? transaction, + }) async { + return session.db.count( + where: where?.call(Quote.t), + limit: limit, + transaction: transaction, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/generated/vote.dart b/wien_talks/wien_talks_server/lib/src/generated/vote.dart new file mode 100644 index 0000000..5a7d1ed --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/generated/vote.dart @@ -0,0 +1,439 @@ +/* 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/serverpod.dart' as _i1; + +abstract class Vote implements _i1.TableRow, _i1.ProtocolSerialization { + Vote._({ + this.id, + required this.userId, + required this.createdAt, + required this.quoteId, + required this.upvote, + }); + + factory Vote({ + int? id, + required int userId, + required DateTime createdAt, + required int quoteId, + required bool upvote, + }) = _VoteImpl; + + factory Vote.fromJson(Map jsonSerialization) { + return Vote( + id: jsonSerialization['id'] as int?, + userId: jsonSerialization['userId'] as int, + createdAt: + _i1.DateTimeJsonExtension.fromJson(jsonSerialization['createdAt']), + quoteId: jsonSerialization['quoteId'] as int, + upvote: jsonSerialization['upvote'] as bool, + ); + } + + static final t = VoteTable(); + + static const db = VoteRepository._(); + + @override + int? id; + + int userId; + + DateTime createdAt; + + int quoteId; + + bool upvote; + + @override + _i1.Table get table => t; + + /// Returns a shallow copy of this [Vote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + Vote copyWith({ + int? id, + int? userId, + DateTime? createdAt, + int? quoteId, + bool? upvote, + }); + @override + Map toJson() { + return { + if (id != null) 'id': id, + 'userId': userId, + 'createdAt': createdAt.toJson(), + 'quoteId': quoteId, + 'upvote': upvote, + }; + } + + @override + Map toJsonForProtocol() { + return { + if (id != null) 'id': id, + 'userId': userId, + 'createdAt': createdAt.toJson(), + 'quoteId': quoteId, + 'upvote': upvote, + }; + } + + static VoteInclude include() { + return VoteInclude._(); + } + + static VoteIncludeList includeList({ + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + VoteInclude? include, + }) { + return VoteIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(Vote.t), + orderDescending: orderDescending, + orderByList: orderByList?.call(Vote.t), + include: include, + ); + } + + @override + String toString() { + return _i1.SerializationManager.encode(this); + } +} + +class _Undefined {} + +class _VoteImpl extends Vote { + _VoteImpl({ + int? id, + required int userId, + required DateTime createdAt, + required int quoteId, + required bool upvote, + }) : super._( + id: id, + userId: userId, + createdAt: createdAt, + quoteId: quoteId, + upvote: upvote, + ); + + /// Returns a shallow copy of this [Vote] + /// with some or all fields replaced by the given arguments. + @_i1.useResult + @override + Vote copyWith({ + Object? id = _Undefined, + int? userId, + DateTime? createdAt, + int? quoteId, + bool? upvote, + }) { + return Vote( + id: id is int? ? id : this.id, + userId: userId ?? this.userId, + createdAt: createdAt ?? this.createdAt, + quoteId: quoteId ?? this.quoteId, + upvote: upvote ?? this.upvote, + ); + } +} + +class VoteTable extends _i1.Table { + VoteTable({super.tableRelation}) : super(tableName: 'vote') { + userId = _i1.ColumnInt( + 'userId', + this, + ); + createdAt = _i1.ColumnDateTime( + 'createdAt', + this, + ); + quoteId = _i1.ColumnInt( + 'quoteId', + this, + ); + upvote = _i1.ColumnBool( + 'upvote', + this, + ); + } + + late final _i1.ColumnInt userId; + + late final _i1.ColumnDateTime createdAt; + + late final _i1.ColumnInt quoteId; + + late final _i1.ColumnBool upvote; + + @override + List<_i1.Column> get columns => [ + id, + userId, + createdAt, + quoteId, + upvote, + ]; +} + +class VoteInclude extends _i1.IncludeObject { + VoteInclude._(); + + @override + Map get includes => {}; + + @override + _i1.Table get table => Vote.t; +} + +class VoteIncludeList extends _i1.IncludeList { + VoteIncludeList._({ + _i1.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderDescending, + super.orderByList, + super.include, + }) { + super.where = where?.call(Vote.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _i1.Table get table => Vote.t; +} + +class VoteRepository { + const VoteRepository._(); + + /// Returns a list of [Vote]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. + /// + /// To specify the order of the items use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// The maximum number of items can be set by [limit]. If no limit is set, + /// all items matching the query will be returned. + /// + /// [offset] defines how many items to skip, after which [limit] (or all) + /// items are read from the database. + /// + /// ```dart + /// var persons = await Persons.db.find( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.firstName, + /// limit: 100, + /// ); + /// ``` + Future> find( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + _i1.Transaction? transaction, + }) async { + return session.db.find( + where: where?.call(Vote.t), + orderBy: orderBy?.call(Vote.t), + orderByList: orderByList?.call(Vote.t), + orderDescending: orderDescending, + limit: limit, + offset: offset, + transaction: transaction, + ); + } + + /// Returns the first matching [Vote] 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. + /// + /// To specify the order use [orderBy] or [orderByList] + /// when sorting by multiple columns. + /// + /// [offset] defines how many items to skip, after which the next one will be picked. + /// + /// ```dart + /// var youngestPerson = await Persons.db.findFirstRow( + /// session, + /// where: (t) => t.lastName.equals('Jones'), + /// orderBy: (t) => t.age, + /// ); + /// ``` + Future findFirstRow( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + _i1.Transaction? transaction, + }) async { + return session.db.findFirstRow( + where: where?.call(Vote.t), + orderBy: orderBy?.call(Vote.t), + orderByList: orderByList?.call(Vote.t), + orderDescending: orderDescending, + offset: offset, + transaction: transaction, + ); + } + + /// Finds a single [Vote] by its [id] or null if no such row exists. + Future findById( + _i1.Session session, + int id, { + _i1.Transaction? transaction, + }) async { + return session.db.findById( + id, + transaction: transaction, + ); + } + + /// Inserts all [Vote]s in the list and returns the inserted rows. + /// + /// The returned [Vote]s will have their `id` fields set. + /// + /// This is an atomic operation, meaning that if one of the rows fails to + /// insert, none of the rows will be inserted. + Future> insert( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.db.insert( + rows, + transaction: transaction, + ); + } + + /// Inserts a single [Vote] and returns the inserted row. + /// + /// The returned [Vote] will have its `id` field set. + Future insertRow( + _i1.Session session, + Vote row, { + _i1.Transaction? transaction, + }) async { + return session.db.insertRow( + row, + transaction: transaction, + ); + } + + /// Updates all [Vote]s in the list and returns the updated rows. If + /// [columns] is provided, only those columns will be updated. Defaults to + /// all columns. + /// This is an atomic operation, meaning that if one of the rows fails to + /// update, none of the rows will be updated. + Future> update( + _i1.Session session, + List rows, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.db.update( + rows, + columns: columns?.call(Vote.t), + transaction: transaction, + ); + } + + /// Updates a single [Vote]. The row needs to have its id set. + /// Optionally, a list of [columns] can be provided to only update those + /// columns. Defaults to all columns. + Future updateRow( + _i1.Session session, + Vote row, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.db.updateRow( + row, + columns: columns?.call(Vote.t), + transaction: transaction, + ); + } + + /// Deletes all [Vote]s in the list and returns the deleted rows. + /// This is an atomic operation, meaning that if one of the rows fail to + /// be deleted, none of the rows will be deleted. + Future> delete( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.db.delete( + rows, + transaction: transaction, + ); + } + + /// Deletes a single [Vote]. + Future deleteRow( + _i1.Session session, + Vote row, { + _i1.Transaction? transaction, + }) async { + return session.db.deleteRow( + row, + transaction: transaction, + ); + } + + /// Deletes all rows matching the [where] expression. + Future> deleteWhere( + _i1.Session session, { + required _i1.WhereExpressionBuilder where, + _i1.Transaction? transaction, + }) async { + return session.db.deleteWhere( + where: where(Vote.t), + transaction: transaction, + ); + } + + /// Counts the number of rows matching the [where] expression. If omitted, + /// will return the count of all rows in the table. + Future count( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + _i1.Transaction? transaction, + }) async { + return session.db.count( + where: where?.call(Vote.t), + limit: limit, + transaction: transaction, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart b/wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart new file mode 100644 index 0000000..c98d76e --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/health/health-endpoint.dart @@ -0,0 +1,23 @@ +import 'package:serverpod/serverpod.dart'; +import 'package:wien_talks_server/src/generated/protocol.dart'; + +class HealthEndpoint extends Endpoint { + Future ping(Session session, {String? note}) async { + final row = await Health.db.insertRow( + session, + Health( + createdAt: DateTime.now().toUtc(), + note: note, + ), + ); + return row; + } + + Future> all(Session session) { + return Health.db.find( + session, + orderBy: (h) => h.createdAt, + orderDescending: true, + ); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/models/create_quote.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/create_quote.spy.yaml new file mode 100644 index 0000000..799ba9d --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/models/create_quote.spy.yaml @@ -0,0 +1,7 @@ + class: CreateQuoteRequest + fields: + text: String + authorName: String? + lat: double + lng: double + tags: List? diff --git a/wien_talks/wien_talks_server/lib/src/models/health.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/health.spy.yaml new file mode 100644 index 0000000..779e344 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/models/health.spy.yaml @@ -0,0 +1,5 @@ +class: Health +table: health +fields: + createdAt: DateTime + note: String? diff --git a/wien_talks/wien_talks_server/lib/src/models/quote.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/quote.spy.yaml new file mode 100644 index 0000000..3a734d5 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/models/quote.spy.yaml @@ -0,0 +1,14 @@ +class: Quote +table: quote +fields: + id: int? + userId: int + text: String + authorName: String? + lat: double + long: double + createdAt: DateTime + visibility: int + upvotes: int + downvotes: int + tags: List? diff --git a/wien_talks/wien_talks_server/lib/src/models/vote.spy.yaml b/wien_talks/wien_talks_server/lib/src/models/vote.spy.yaml new file mode 100644 index 0000000..2f1e878 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/models/vote.spy.yaml @@ -0,0 +1,7 @@ +class: Vote +table: vote +fields: + userId: int + createdAt: DateTime + quoteId: int + upvote: bool diff --git a/wien_talks/wien_talks_server/lib/src/quotes/quote_util.dart b/wien_talks/wien_talks_server/lib/src/quotes/quote_util.dart new file mode 100644 index 0000000..533ee21 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/quotes/quote_util.dart @@ -0,0 +1,28 @@ +import 'package:serverpod/serverpod.dart'; +import 'package:wien_talks_server/src/generated/protocol.dart'; + +String validateQuote(CreateQuoteRequest req) { + final text = req.text.trim(); + if (text.isEmpty || text.length > 500) { + throw FormatException('Text must be 1..500 chars'); + } + if (req.lat.isNaN || req.lng.isNaN) { + throw FormatException('Invalid coordinates'); + } + if (req.lat < -90 || req.lat > 90 || req.lng < -180 || req.lng > 180) { + throw FormatException('Coordinates out of bounds'); + } + return text; +} + +Future> listNearby( + Session session, { + required double lat, + required double lng, + int radiusMeters = 1500, + int limit = 50, +}) async { + throw UnimplementedError(); +} + +enum Visibility { public, private, locallyPublic } diff --git a/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart b/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart new file mode 100644 index 0000000..fd501e2 --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart @@ -0,0 +1,101 @@ +import 'dart:async'; +import 'dart:math'; + +import 'package:serverpod/serverpod.dart'; +import 'package:wien_talks_server/src/generated/protocol.dart'; +import 'package:wien_talks_server/src/quotes/quote_util.dart'; + +class QuoteEndpoint extends Endpoint { + static const _channelQuoteUpdates = 'quote-updates'; + + Future createQuote(Session session, CreateQuoteRequest req) async { + final authInfo = await session.authenticated; + final userId = authInfo?.userId; + + final text = validateQuote(req); + + final toInsert = Quote( + userId: userId ?? Random().nextInt(1200), + text: text, + authorName: req.authorName, + lat: req.lat, + long: req.lng, + createdAt: DateTime.now().toUtc(), + visibility: 0, + upvotes: 0, + downvotes: 0, + ); + + final inserted = await session.db.insertRow(toInsert); + await session.messages.postMessage(_channelQuoteUpdates, inserted); + return inserted; + } + + Future updateQuote(Session session, Quote quote) async { + await Quote.db.updateRow(session, quote); + await session.messages.postMessage(_channelQuoteUpdates, quote); + } + + Future> getAllQuotes( + Session session, + ) async { + session.log('$session'); + + final quoteList = await Quote.db.find( + session, + orderBy: (t) => t.createdAt, + orderDescending: true, + ); + + for (var element in quoteList) { + session.log(element.text); + } + + return quoteList; + } + + Stream streamAllQuotes(Session session, {int limit = 50}) { + final controller = StreamController(); + final live = session.messages.createStream(_channelQuoteUpdates); + + StreamSubscription? sub; + sub = live.listen( + (q) { + if (q.visibility == 0) controller.add(q); + }, + onError: controller.addError, + onDone: () { + if (!controller.isClosed) controller.close(); + }, + ); + + () async { + try { + final snapshot = await Quote.db.find( + session, + where: (t) => t.visibility.equals(0), + orderBy: (t) => t.createdAt, + orderDescending: true, + limit: limit, + ); + + var i = 0; + for (final q in snapshot.reversed) { + controller.add(q); + if ((++i % 25) == 0) { + await Future.delayed(Duration.zero); + } + } + } catch (e, st) { + controller.addError(e, st); + } + }(); + + controller.onCancel = () async { + await sub?.cancel(); + await controller.close(); + }; + + return controller.stream; + } +} diff --git a/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart b/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart new file mode 100644 index 0000000..99b153c --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/votes/votes_endpoint.dart @@ -0,0 +1,30 @@ +import 'dart:math'; + +import 'package:serverpod/serverpod.dart'; +import 'package:wien_talks_server/src/generated/protocol.dart'; + +class VotesEndpoint extends Endpoint { + Future> getAllVotes(Session session) async { + return await Vote.db.find( + session, + orderBy: (v) => v.createdAt, + orderDescending: true, + ); + } + + Future createVote(Session session) async { + final vote = await Vote.db.insertRow( + session, + Vote( + userId: Random().nextInt(122), + createdAt: DateTime.now(), + quoteId: Random().nextInt(122), + upvote: true)); + + return '${vote.id}'; + } + + Future sayHello(Session session) async { + return 'hello'; + } +} diff --git a/wien_talks/wien_talks_server/lib/src/web/routes/root.dart b/wien_talks/wien_talks_server/lib/src/web/routes/root.dart new file mode 100644 index 0000000..7c4a02e --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/web/routes/root.dart @@ -0,0 +1,11 @@ +import 'dart:io'; + +import 'package:wien_talks_server/src/web/widgets/built_with_serverpod_page.dart'; +import 'package:serverpod/serverpod.dart'; + +class RouteRoot extends WidgetRoute { + @override + Future build(Session session, HttpRequest request) async { + return BuiltWithServerpodPage(); + } +} diff --git a/wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart b/wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart new file mode 100644 index 0000000..233327c --- /dev/null +++ b/wien_talks/wien_talks_server/lib/src/web/widgets/built_with_serverpod_page.dart @@ -0,0 +1,11 @@ +import 'package:serverpod/serverpod.dart'; + +/// A widget that displays the Serverpod version and the current run mode. +/// It uses the built_with_serverpod.html template to render the page. +/// The [name] of the template should correspond to a template file in your +/// server's web/templates directory. +class BuiltWithServerpodPage extends Widget { + BuiltWithServerpodPage() : super(name: 'built_with_serverpod') { + values = {'served': DateTime.now(), 'runmode': Serverpod.instance.runMode}; + } +} diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/definition.json b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.json new file mode 100644 index 0000000..a90fc50 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.json @@ -0,0 +1,1855 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816212658542" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql new file mode 100644 index 0000000..391f78e --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/definition.sql @@ -0,0 +1,405 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quote" json NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816212658542', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816212658542', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json new file mode 100644 index 0000000..a405534 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/definition_project.json @@ -0,0 +1,162 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/migration.json b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.json new file mode 100644 index 0000000..3c6760d --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.json @@ -0,0 +1,1910 @@ +{ + "actions": [ + { + "type": "createTable", + "createTable": { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + }, + { + "type": "createTable", + "createTable": { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212658542/migration.sql b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.sql new file mode 100644 index 0000000..4570684 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212658542/migration.sql @@ -0,0 +1,405 @@ +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 +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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 +); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- ACTION CREATE TABLE +-- +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 +); + +-- +-- ACTION CREATE TABLE +-- +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"); + +-- +-- 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 +-- +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; + +-- +-- ACTION CREATE FOREIGN KEY +-- +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; + +-- +-- ACTION CREATE FOREIGN KEY +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816212658542', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816212658542', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/definition.json b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.json new file mode 100644 index 0000000..2f07479 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.json @@ -0,0 +1,1855 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816212959541" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql new file mode 100644 index 0000000..e8fd79c --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/definition.sql @@ -0,0 +1,405 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quote" json NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816212959541', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816212959541', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json new file mode 100644 index 0000000..a405534 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/definition_project.json @@ -0,0 +1,162 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quote", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:Quote" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/migration.json b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816212959541/migration.sql b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.sql new file mode 100644 index 0000000..17506d8 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816212959541/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816212959541', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816212959541', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/definition.json b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.json new file mode 100644 index 0000000..d798718 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.json @@ -0,0 +1,1849 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816214717668" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/definition.sql b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.sql new file mode 100644 index 0000000..5b0a366 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/definition.sql @@ -0,0 +1,404 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816214717668', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816214717668', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816214717668/definition_project.json new file mode 100644 index 0000000..29120e1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/definition_project.json @@ -0,0 +1,156 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/migration.json b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.json new file mode 100644 index 0000000..c267325 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.json @@ -0,0 +1,43 @@ +{ + "actions": [ + { + "type": "alterTable", + "alterTable": { + "name": "vote", + "schema": "public", + "addColumns": [], + "deleteColumns": [ + "quote" + ], + "modifyColumns": [], + "addIndexes": [], + "deleteIndexes": [], + "addForeignKeys": [], + "deleteForeignKeys": [], + "warnings": [ + { + "type": "columnDropped", + "message": "Column \"quote\" of table \"vote\" will be dropped.", + "table": "vote", + "columns": [ + "quote" + ], + "destrucive": true + } + ] + } + } + ], + "warnings": [ + { + "type": "columnDropped", + "message": "Column \"quote\" of table \"vote\" will be dropped.", + "table": "vote", + "columns": [ + "quote" + ], + "destrucive": true + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql new file mode 100644 index 0000000..e6a6930 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816214717668/migration.sql @@ -0,0 +1,33 @@ +BEGIN; + +-- +-- ACTION ALTER TABLE +-- +ALTER TABLE "vote" DROP COLUMN "quote"; + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816214717668', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816214717668', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/definition.json b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.json new file mode 100644 index 0000000..ef49ab3 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.json @@ -0,0 +1,1849 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816215043551" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/definition.sql b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.sql new file mode 100644 index 0000000..2f0363a --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/definition.sql @@ -0,0 +1,404 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215043551', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215043551', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816215043551/definition_project.json new file mode 100644 index 0000000..29120e1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/definition_project.json @@ -0,0 +1,156 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/migration.json b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql new file mode 100644 index 0000000..654d41e --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215043551/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215043551', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215043551', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/definition.json b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.json new file mode 100644 index 0000000..7aba8ce --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.json @@ -0,0 +1,1849 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816215049795" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/definition.sql b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.sql new file mode 100644 index 0000000..fea42e4 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/definition.sql @@ -0,0 +1,404 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215049795', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215049795', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json new file mode 100644 index 0000000..29120e1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/definition_project.json @@ -0,0 +1,156 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/migration.json b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql new file mode 100644 index 0000000..327442d --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215049795/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215049795', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215049795', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/definition.json b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.json new file mode 100644 index 0000000..6bc981d --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.json @@ -0,0 +1,1849 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816215102447" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql new file mode 100644 index 0000000..386eb66 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/definition.sql @@ -0,0 +1,404 @@ +BEGIN; + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215102447', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215102447', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json new file mode 100644 index 0000000..29120e1 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/definition_project.json @@ -0,0 +1,156 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/migration.json b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.json new file mode 100644 index 0000000..056118b --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.json @@ -0,0 +1,5 @@ +{ + "actions": [], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql new file mode 100644 index 0000000..87e7234 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816215102447/migration.sql @@ -0,0 +1,29 @@ +BEGIN; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816215102447', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816215102447', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/definition.json b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.json new file mode 100644 index 0000000..15189fb --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.json @@ -0,0 +1,1898 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "health", + "dartName": "Health", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('health_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "health_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quoteId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "addedTime", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + }, + { + "name": "byteData", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "verified", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_path_idx", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_cloud_storage_expiration", + "elements": [ + { + "type": 0, + "definition": "expiration" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_cloud_storage_direct_upload", + "dartName": "CloudStorageDirectUploadEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_cloud_storage_direct_upload_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "storageId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "path", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "authKey", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_cloud_storage_direct_upload_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_cloud_storage_direct_upload_storage_path", + "elements": [ + { + "type": 0, + "definition": "storageId" + }, + { + "type": 0, + "definition": "path" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_future_call", + "dartName": "FutureCallEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_future_call_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "serializedObject", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "identifier", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_future_call_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_future_call_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_serverId_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_future_call_identifier_idx", + "elements": [ + { + "type": 0, + "definition": "identifier" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_connection_info", + "dartName": "ServerHealthConnectionInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_connection_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "active", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_connection_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_connection_info_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_health_metric", + "dartName": "ServerHealthMetric", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_health_metric_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "name", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "isHealthy", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "value", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "granularity", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_health_metric_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_health_metric_timestamp_idx", + "elements": [ + { + "type": 0, + "definition": "timestamp" + }, + { + "type": 0, + "definition": "serverId" + }, + { + "type": 0, + "definition": "name" + }, + { + "type": 0, + "definition": "granularity" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_log", + "dartName": "LogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "reference", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "logLevel", + "columnType": 6, + "isNullable": false, + "dartType": "protocol:LogLevel" + }, + { + "name": "message", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_message_log", + "dartName": "MessageLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_message_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_message_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_method", + "dartName": "MethodInfo", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_method_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_method_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_method_endpoint_method_idx", + "elements": [ + { + "type": 0, + "definition": "endpoint" + }, + { + "type": 0, + "definition": "method" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_migrations", + "dartName": "DatabaseMigrationVersion", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_migrations_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "module", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "version", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "timestamp", + "columnType": 4, + "isNullable": true, + "dartType": "DateTime?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_migrations_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_migrations_ids", + "elements": [ + { + "type": 0, + "definition": "module" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_query_log", + "dartName": "QueryLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "order", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [ + { + "constraintName": "serverpod_query_log_fk_0", + "columns": [ + "sessionLogId" + ], + "referenceTable": "serverpod_session_log", + "referenceTableSchema": "public", + "referenceColumns": [ + "id" + ], + "onUpdate": 3, + "onDelete": 4 + } + ], + "indexes": [ + { + "indexName": "serverpod_query_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_query_log_sessionLogId_idx", + "elements": [ + { + "type": 0, + "definition": "sessionLogId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_readwrite_test", + "dartName": "ReadWriteTestEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 6, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_readwrite_test_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_runtime_settings", + "dartName": "RuntimeSettings", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_runtime_settings_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "logSettings", + "columnType": 8, + "isNullable": false, + "dartType": "protocol:LogSettings" + }, + { + "name": "logSettingsOverrides", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "logServiceCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + }, + { + "name": "logMalformedCalls", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_runtime_settings_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_session_log", + "dartName": "SessionLogEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_session_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "module", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "endpoint", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "method", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": true, + "dartType": "double?" + }, + { + "name": "numQueries", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "slow", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "error", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "stackTrace", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "authenticatedUserId", + "columnType": 6, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "isOpen", + "columnType": 1, + "isNullable": true, + "dartType": "bool?" + }, + { + "name": "touched", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_session_log_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_session_log_serverid_idx", + "elements": [ + { + "type": 0, + "definition": "serverId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_touched_idx", + "elements": [ + { + "type": 0, + "definition": "touched" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_session_log_isopen_idx", + "elements": [ + { + "type": 0, + "definition": "isOpen" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "method", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_auth_key_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_auth_key_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_auth", + "dartName": "EmailAuth", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_auth_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_auth_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_create_request", + "dartName": "EmailCreateAccountRequest", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_create_request_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "hash", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_create_request_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_auth_create_account_request_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_failed_sign_in", + "dartName": "EmailFailedSignIn", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_failed_sign_in_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "time", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "ipAddress", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_failed_sign_in_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_failed_sign_in_email_idx", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + }, + { + "indexName": "serverpod_email_failed_sign_in_time_idx", + "elements": [ + { + "type": 0, + "definition": "time" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_email_reset", + "dartName": "EmailReset", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_email_reset_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "verificationCode", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "expiration", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_email_reset_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_email_reset_verification_idx", + "elements": [ + { + "type": 0, + "definition": "verificationCode" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_google_refresh_token", + "dartName": "GoogleRefreshToken", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_google_refresh_token_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "refreshToken", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_google_refresh_token_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_google_refresh_token_userId_idx", + "elements": [ + { + "type": 0, + "definition": "userId" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_image", + "dartName": "UserImage", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_image_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "version", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "url", + "columnType": 0, + "isNullable": false, + "dartType": "String" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_image_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_image_user_id", + "elements": [ + { + "type": 0, + "definition": "userId" + }, + { + "type": 0, + "definition": "version" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + }, + { + "name": "serverpod_user_info", + "dartName": "UserInfo", + "module": "serverpod_auth", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('serverpod_user_info_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userIdentifier", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "userName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "fullName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "email", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "created", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "imageUrl", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "scopeNames", + "columnType": 8, + "isNullable": false, + "dartType": "List" + }, + { + "name": "blocked", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "serverpod_user_info_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + }, + { + "indexName": "serverpod_user_info_user_identifier", + "elements": [ + { + "type": 0, + "definition": "userIdentifier" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": false + }, + { + "indexName": "serverpod_user_info_email", + "elements": [ + { + "type": 0, + "definition": "email" + } + ], + "type": "btree", + "isUnique": false, + "isPrimary": false + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "wien_talks", + "version": "20250816220051483" + }, + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql new file mode 100644 index 0000000..a916057 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/definition.sql @@ -0,0 +1,414 @@ +BEGIN; + +-- +-- Class Health as table health +-- +CREATE TABLE "health" ( + "id" bigserial PRIMARY KEY, + "createdAt" timestamp without time zone NOT NULL, + "note" text +); + +-- +-- Class Quote as table quote +-- +CREATE TABLE "quote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "text" text NOT NULL, + "authorName" text, + "lat" double precision NOT NULL, + "long" double precision NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "visibility" bigint NOT NULL, + "upvotes" bigint NOT NULL, + "downvotes" bigint NOT NULL, + "tags" json +); + +-- +-- Class Vote as table vote +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quoteId" bigint NOT NULL, + "upvote" boolean NOT NULL +); + +-- +-- Class CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "addedTime" timestamp without time zone NOT NULL, + "expiration" timestamp without time zone, + "byteData" bytea NOT NULL, + "verified" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_path_idx" ON "serverpod_cloud_storage" USING btree ("storageId", "path"); +CREATE INDEX "serverpod_cloud_storage_expiration" ON "serverpod_cloud_storage" USING btree ("expiration"); + +-- +-- Class CloudStorageDirectUploadEntry as table serverpod_cloud_storage_direct_upload +-- +CREATE TABLE "serverpod_cloud_storage_direct_upload" ( + "id" bigserial PRIMARY KEY, + "storageId" text NOT NULL, + "path" text NOT NULL, + "expiration" timestamp without time zone NOT NULL, + "authKey" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_cloud_storage_direct_upload_storage_path" ON "serverpod_cloud_storage_direct_upload" USING btree ("storageId", "path"); + +-- +-- Class FutureCallEntry as table serverpod_future_call +-- +CREATE TABLE "serverpod_future_call" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "serializedObject" text, + "serverId" text NOT NULL, + "identifier" text +); + +-- Indexes +CREATE INDEX "serverpod_future_call_time_idx" ON "serverpod_future_call" USING btree ("time"); +CREATE INDEX "serverpod_future_call_serverId_idx" ON "serverpod_future_call" USING btree ("serverId"); +CREATE INDEX "serverpod_future_call_identifier_idx" ON "serverpod_future_call" USING btree ("identifier"); + +-- +-- Class ServerHealthConnectionInfo as table serverpod_health_connection_info +-- +CREATE TABLE "serverpod_health_connection_info" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" bigint NOT NULL, + "closing" bigint NOT NULL, + "idle" bigint NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_connection_info_timestamp_idx" ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "granularity"); + +-- +-- Class ServerHealthMetric as table serverpod_health_metric +-- +CREATE TABLE "serverpod_health_metric" ( + "id" bigserial PRIMARY KEY, + "name" text NOT NULL, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "isHealthy" boolean NOT NULL, + "value" double precision NOT NULL, + "granularity" bigint NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_health_metric_timestamp_idx" ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name", "granularity"); + +-- +-- Class LogEntry as table serverpod_log +-- +CREATE TABLE "serverpod_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" bigint NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- Class MessageLogEntry as table serverpod_message_log +-- +CREATE TABLE "serverpod_message_log" ( + "id" bigserial PRIMARY KEY, + "sessionLogId" bigint NOT NULL, + "serverId" text NOT NULL, + "messageId" bigint NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" bigserial PRIMARY KEY, + "endpoint" text NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_method_endpoint_method_idx" ON "serverpod_method" USING btree ("endpoint", "method"); + +-- +-- Class DatabaseMigrationVersion as table serverpod_migrations +-- +CREATE TABLE "serverpod_migrations" ( + "id" bigserial PRIMARY KEY, + "module" text NOT NULL, + "version" text NOT NULL, + "timestamp" timestamp without time zone +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_migrations_ids" ON "serverpod_migrations" USING btree ("module"); + +-- +-- Class QueryLogEntry as table serverpod_query_log +-- +CREATE TABLE "serverpod_query_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" bigint NOT NULL, + "messageId" bigint, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" bigint, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" bigint NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_query_log_sessionLogId_idx" ON "serverpod_query_log" USING btree ("sessionLogId"); + +-- +-- Class ReadWriteTestEntry as table serverpod_readwrite_test +-- +CREATE TABLE "serverpod_readwrite_test" ( + "id" bigserial PRIMARY KEY, + "number" bigint NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" bigserial PRIMARY KEY, + "logSettings" json NOT NULL, + "logSettingsOverrides" json NOT NULL, + "logServiceCalls" boolean NOT NULL, + "logMalformedCalls" boolean NOT NULL +); + +-- +-- Class SessionLogEntry as table serverpod_session_log +-- +CREATE TABLE "serverpod_session_log" ( + "id" bigserial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" bigint, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" bigint, + "isOpen" boolean, + "touched" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_session_log_serverid_idx" ON "serverpod_session_log" USING btree ("serverId"); +CREATE INDEX "serverpod_session_log_touched_idx" ON "serverpod_session_log" USING btree ("touched"); +CREATE INDEX "serverpod_session_log_isopen_idx" ON "serverpod_session_log" USING btree ("isOpen"); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "hash" text NOT NULL, + "scopeNames" json NOT NULL, + "method" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_auth_key_userId_idx" ON "serverpod_auth_key" USING btree ("userId"); + +-- +-- Class EmailAuth as table serverpod_email_auth +-- +CREATE TABLE "serverpod_email_auth" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_email" ON "serverpod_email_auth" USING btree ("email"); + +-- +-- Class EmailCreateAccountRequest as table serverpod_email_create_request +-- +CREATE TABLE "serverpod_email_create_request" ( + "id" bigserial PRIMARY KEY, + "userName" text NOT NULL, + "email" text NOT NULL, + "hash" text NOT NULL, + "verificationCode" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_auth_create_account_request_idx" ON "serverpod_email_create_request" USING btree ("email"); + +-- +-- Class EmailFailedSignIn as table serverpod_email_failed_sign_in +-- +CREATE TABLE "serverpod_email_failed_sign_in" ( + "id" bigserial PRIMARY KEY, + "email" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "ipAddress" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_email_failed_sign_in_email_idx" ON "serverpod_email_failed_sign_in" USING btree ("email"); +CREATE INDEX "serverpod_email_failed_sign_in_time_idx" ON "serverpod_email_failed_sign_in" USING btree ("time"); + +-- +-- Class EmailReset as table serverpod_email_reset +-- +CREATE TABLE "serverpod_email_reset" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "verificationCode" text NOT NULL, + "expiration" timestamp without time zone NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_email_reset_verification_idx" ON "serverpod_email_reset" USING btree ("verificationCode"); + +-- +-- Class GoogleRefreshToken as table serverpod_google_refresh_token +-- +CREATE TABLE "serverpod_google_refresh_token" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "refreshToken" text NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_google_refresh_token_userId_idx" ON "serverpod_google_refresh_token" USING btree ("userId"); + +-- +-- Class UserImage as table serverpod_user_image +-- +CREATE TABLE "serverpod_user_image" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "version" bigint NOT NULL, + "url" text NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_user_image_user_id" ON "serverpod_user_image" USING btree ("userId", "version"); + +-- +-- Class UserInfo as table serverpod_user_info +-- +CREATE TABLE "serverpod_user_info" ( + "id" bigserial PRIMARY KEY, + "userIdentifier" text NOT NULL, + "userName" text, + "fullName" text, + "email" text, + "created" timestamp without time zone NOT NULL, + "imageUrl" text, + "scopeNames" json NOT NULL, + "blocked" boolean NOT NULL +); + +-- Indexes +CREATE UNIQUE INDEX "serverpod_user_info_user_identifier" ON "serverpod_user_info" USING btree ("userIdentifier"); +CREATE INDEX "serverpod_user_info_email" ON "serverpod_user_info" USING btree ("email"); + +-- +-- Foreign relations for "serverpod_log" table +-- +ALTER TABLE ONLY "serverpod_log" + ADD CONSTRAINT "serverpod_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_message_log" table +-- +ALTER TABLE ONLY "serverpod_message_log" + ADD CONSTRAINT "serverpod_message_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + +-- +-- Foreign relations for "serverpod_query_log" table +-- +ALTER TABLE ONLY "serverpod_query_log" + ADD CONSTRAINT "serverpod_query_log_fk_0" + FOREIGN KEY("sessionLogId") + REFERENCES "serverpod_session_log"("id") + ON DELETE CASCADE + ON UPDATE NO ACTION; + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816220051483', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816220051483', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json b/wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json new file mode 100644 index 0000000..9bcbc1f --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/definition_project.json @@ -0,0 +1,205 @@ +{ + "moduleName": "wien_talks", + "tables": [ + { + "name": "health", + "dartName": "Health", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('health_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "health_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "quote", + "dartName": "Quote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('quote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "text", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "authorName", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + }, + { + "name": "lat", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "long", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "visibility", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "downvotes", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "tags", + "columnType": 8, + "isNullable": true, + "dartType": "List?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "quote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quoteId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240516151843329" + }, + { + "module": "serverpod_auth", + "version": "20240520102713718" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/migration.json b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.json new file mode 100644 index 0000000..f940f22 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.json @@ -0,0 +1,124 @@ +{ + "actions": [ + { + "type": "createTable", + "createTable": { + "name": "health", + "dartName": "Health", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('health_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "note", + "columnType": 0, + "isNullable": true, + "dartType": "String?" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "health_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + }, + { + "type": "deleteTable", + "deleteTable": "vote" + }, + { + "type": "createTable", + "createTable": { + "name": "vote", + "dartName": "Vote", + "module": "wien_talks", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 6, + "isNullable": false, + "columnDefault": "nextval('vote_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "createdAt", + "columnType": 4, + "isNullable": false, + "dartType": "DateTime" + }, + { + "name": "quoteId", + "columnType": 6, + "isNullable": false, + "dartType": "int" + }, + { + "name": "upvote", + "columnType": 1, + "isNullable": false, + "dartType": "bool" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "vote_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + } + ], + "warnings": [ + { + "type": "tableDropped", + "message": "One or more columns are added to table \"vote\" which cannot be added in a table migration. The complete table will be deleted and recreated.", + "table": "vote", + "columns": [ + "quoteId" + ], + "destrucive": true + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql new file mode 100644 index 0000000..72fd386 --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/20250816220051483/migration.sql @@ -0,0 +1,54 @@ +BEGIN; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "health" ( + "id" bigserial PRIMARY KEY, + "createdAt" timestamp without time zone NOT NULL, + "note" text +); + +-- +-- ACTION DROP TABLE +-- +DROP TABLE "vote" CASCADE; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "vote" ( + "id" bigserial PRIMARY KEY, + "userId" bigint NOT NULL, + "createdAt" timestamp without time zone NOT NULL, + "quoteId" bigint NOT NULL, + "upvote" boolean NOT NULL +); + + +-- +-- MIGRATION VERSION FOR wien_talks +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('wien_talks', '20250816220051483', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20250816220051483', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240516151843329', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240516151843329', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod_auth +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod_auth', '20240520102713718', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240520102713718', "timestamp" = now(); + + +COMMIT; diff --git a/wien_talks/wien_talks_server/migrations/migration_registry.txt b/wien_talks/wien_talks_server/migrations/migration_registry.txt new file mode 100644 index 0000000..a52cc5d --- /dev/null +++ b/wien_talks/wien_talks_server/migrations/migration_registry.txt @@ -0,0 +1,13 @@ +### AUTOMATICALLY GENERATED DO NOT MODIFY +### +### This file is generated by Serverpod when creating a migration, do not modify it +### 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 diff --git a/wien_talks/wien_talks_server/pubspec.lock b/wien_talks/wien_talks_server/pubspec.lock new file mode 100644 index 0000000..8cadb10 --- /dev/null +++ b/wien_talks/wien_talks_server/pubspec.lock @@ -0,0 +1,733 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _discoveryapis_commons: + dependency: transitive + description: + name: _discoveryapis_commons + sha256: "113c4100b90a5b70a983541782431b82168b3cae166ab130649c36eb3559d498" + url: "https://pub.dev" + source: hosted + version: "1.0.7" + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: f0bb5d1648339c8308cc0b9838d8456b3cfe5c91f9dc1a735b4d003269e5da9a + url: "https://pub.dev" + source: hosted + version: "88.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "0b7b9c329d2879f8f05d6c05b32ee9ec025f39b077864bdb5ac9a7b63418a98f" + url: "https://pub.dev" + source: hosted + version: "8.1.1" + archive: + dependency: transitive + description: + name: archive + sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + url: "https://pub.dev" + source: hosted + version: "4.0.7" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" + url: "https://pub.dev" + source: hosted + version: "1.6.5" + async: + dependency: transitive + description: + name: async + sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + url: "https://pub.dev" + source: hosted + version: "2.13.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + buffer: + dependency: transitive + description: + name: buffer + sha256: "389da2ec2c16283c8787e0adaede82b1842102f8c8aae2f49003a766c5c6b3d1" + url: "https://pub.dev" + source: hosted + version: "1.2.3" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb0f1107cac15a5ea6ef0a6ef71a807b9e4267c713bb93e00e92d737cc8dbd8a + url: "https://pub.dev" + source: hosted + version: "1.4.0" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + crypto_keys: + dependency: transitive + description: + name: crypto_keys + sha256: acc19abf34623d990a0e8aec69463d74a824c31f137128f42e2810befc509ad0 + url: "https://pub.dev" + source: hosted + version: "0.3.0+1" + email_validator: + dependency: transitive + description: + name: email_validator + sha256: b19aa5d92fdd76fbc65112060c94d45ba855105a28bb6e462de7ff03b12fa1fb + url: "https://pub.dev" + source: hosted + version: "3.0.0" + ffi: + dependency: transitive + description: + name: ffi + sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter_lints: + dependency: transitive + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "5d187c46dc59e02646e10fe82665fc3884a9b71bc1c90c2b8b749316d33ee454" + url: "https://pub.dev" + source: hosted + version: "0.3.3+1" + googleapis: + dependency: transitive + description: + name: googleapis + sha256: "5c9e0f25be1dec13d8d2158263141104c51b5ba83487537c17a2330581e505ee" + url: "https://pub.dev" + source: hosted + version: "14.0.0" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + sha256: b81fe352cc4a330b3710d2b7ad258d9bcef6f909bb759b306bf42973a7d046db + url: "https://pub.dev" + source: hosted + version: "2.0.0" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.dev" + source: hosted + version: "1.5.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + image: + dependency: transitive + description: + name: image + sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928" + url: "https://pub.dev" + source: hosted + version: "4.5.4" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + jose: + dependency: transitive + description: + name: jose + sha256: "7955ec5d131960104e81fbf151abacb9d835c16c9e793ed394b2809f28b2198d" + url: "https://pub.dev" + source: hosted + version: "0.3.4" + js: + dependency: transitive + description: + name: js + sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" + url: "https://pub.dev" + source: hosted + version: "0.7.2" + lints: + dependency: "direct dev" + description: + name: lints + sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + url: "https://pub.dev" + source: hosted + version: "0.12.17" + meta: + dependency: transitive + description: + name: meta + sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + url: "https://pub.dev" + source: hosted + version: "1.17.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mustache_template: + dependency: transitive + description: + name: mustache_template + sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c + url: "https://pub.dev" + source: hosted + version: "2.0.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + openid_client: + dependency: transitive + description: + name: openid_client + sha256: "1d39a829dc770947bf8ec8684a3456743ef0205a777371efe16773a44163eb6a" + url: "https://pub.dev" + source: hosted + version: "0.4.9" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + url: "https://pub.dev" + source: hosted + version: "7.0.1" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" + url: "https://pub.dev" + source: hosted + version: "3.9.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: "6323a5b0fa688b6a010df4905a56b00181479e6d10534cecfecede2aa55add61" + url: "https://pub.dev" + source: hosted + version: "6.0.3" + postgres: + dependency: transitive + description: + name: postgres + sha256: "9aaa6f4872956adef653535a4e2133b167465c1a68c22b9bd0744ef1244e9393" + url: "https://pub.dev" + source: hosted + version: "3.5.6" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + quiver: + dependency: transitive + description: + name: quiver + sha256: ea0b925899e64ecdfbf9c7becb60d5b50e706ade44a85b2363be2a22d88117d2 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + redis: + dependency: transitive + description: + name: redis + sha256: "4a8218ef7b0642ff499147c7a105591208259e2f55f07db0101ace7f82f66cf9" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + sasl_scram: + dependency: transitive + description: + name: sasl_scram + sha256: a47207a436eb650f8fdcf54a2e2587b850dc3caef9973ce01f332b07a6fc9cb9 + url: "https://pub.dev" + source: hosted + version: "0.1.1" + saslprep: + dependency: transitive + description: + name: saslprep + sha256: "3d421d10be9513bf4459c17c5e70e7b8bc718c9fc5ad4ba5eb4f5fd27396f740" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + serverpod: + dependency: "direct main" + description: + name: serverpod + sha256: ffb358e9ff84bf546ee612b4b5a5f5556bd9840e4a8f06d825efb77a4dd3009e + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_auth_server: + dependency: "direct main" + description: + name: serverpod_auth_server + sha256: ad393f09b5ed82b624c9d299b61d945fb07729a0a704faa67795588200168369 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_lints: + dependency: transitive + description: + name: serverpod_lints + sha256: dc6f9c52fbbb39ca6b8f4a3dbdfaceb17c30fd5299a1a9bbd05da942d8bc2fd8 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_serialization: + dependency: transitive + description: + name: serverpod_serialization + sha256: c301a5e45610c062e51e1ba580f51f3257c3404ce2dd2f7e216dccbd93869502 + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_shared: + dependency: transitive + description: + name: serverpod_shared + sha256: "4c88ca57d90138a01d70a5e28f206c86f9ec43a9215de06ee6a5d0c95049d519" + url: "https://pub.dev" + source: hosted + version: "2.9.1" + serverpod_test: + dependency: "direct dev" + description: + name: serverpod_test + sha256: c0ad3a29f9b60dbf3e47cd313cf48a0d87d4db2f26e21a14e44734146dc5a22b + url: "https://pub.dev" + source: hosted + version: "2.9.1" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "3632775c8e90d6c9712f883e633716432a27758216dfb61bd86a8321c0580925" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + super_string: + dependency: transitive + description: + name: super_string + sha256: ba41acf9fbb318b3fc0d57c9235779100394d85d83f45ab533615df1f3146ea7 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 + url: "https://pub.dev" + source: hosted + version: "3.4.0" + system_resources: + dependency: transitive + description: + name: system_resources + sha256: "7e78cf8ef224c1e0b6bf4462322b6739fea2274fef928cbcbf21ae5e5a8272d8" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test: + dependency: "direct dev" + description: + name: test + sha256: "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7" + url: "https://pub.dev" + source: hosted + version: "1.26.3" + test_api: + dependency: transitive + description: + name: test_api + sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55 + url: "https://pub.dev" + source: hosted + version: "0.7.7" + test_core: + dependency: transitive + description: + name: test_core + sha256: "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0" + url: "https://pub.dev" + source: hosted + version: "0.6.12" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + unorm_dart: + dependency: transitive + description: + name: unorm_dart + sha256: "8e3870a1caa60bde8352f9597dd3535d8068613269444f8e35ea8925ec84c1f5" + url: "https://pub.dev" + source: hosted + version: "0.3.1+1" + uuid: + dependency: transitive + description: + name: uuid + sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + url: "https://pub.dev" + source: hosted + version: "4.5.1" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60" + url: "https://pub.dev" + source: hosted + version: "15.0.2" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + x509: + dependency: transitive + description: + name: x509 + sha256: cbd1a63846884afd273cda247b0365284c8d85a365ca98e110413f93d105b935 + url: "https://pub.dev" + source: hosted + version: "0.2.4+3" + xml: + dependency: transitive + description: + name: xml + sha256: "3202a47961c1a0af6097c9f8c1b492d705248ba309e6f7a72410422c05046851" + url: "https://pub.dev" + source: hosted + version: "6.6.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.8.0 <4.0.0" diff --git a/wien_talks/wien_talks_server/pubspec.yaml b/wien_talks/wien_talks_server/pubspec.yaml new file mode 100644 index 0000000..9df0369 --- /dev/null +++ b/wien_talks/wien_talks_server/pubspec.yaml @@ -0,0 +1,17 @@ +name: wien_talks_server +description: Starting point for a Serverpod server. +# version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=3.5.0 <4.0.0' + +dependencies: + serverpod: 2.9.1 + serverpod_auth_server: ^2.9.1 + +dev_dependencies: + lints: '>=3.0.0 <7.0.0' + test: '^1.24.2' + serverpod_test: 2.9.1 + diff --git a/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart b/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart new file mode 100644 index 0000000..a54a450 --- /dev/null +++ b/wien_talks/wien_talks_server/test/integration/test_tools/serverpod_test_tools.dart @@ -0,0 +1,419 @@ +/* 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_local_identifiers + +// ignore_for_file: no_leading_underscores_for_library_prefixes +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/protocol.dart'; +import 'package:wien_talks_server/src/generated/endpoints.dart'; +export 'package:serverpod_test/serverpod_test_public_exports.dart'; + +/// Creates a new test group that takes a callback that can be used to write tests. +/// The callback has two parameters: `sessionBuilder` and `endpoints`. +/// `sessionBuilder` is used to build a `Session` object that represents the server state during an endpoint call and is used to set up scenarios. +/// `endpoints` contains all your Serverpod endpoints and lets you call them: +/// ```dart +/// withServerpod('Given Example endpoint', (sessionBuilder, endpoints) { +/// test('when calling `hello` then should return greeting', () async { +/// final greeting = await endpoints.example.hello(sessionBuilder, 'Michael'); +/// expect(greeting, 'Hello Michael'); +/// }); +/// }); +/// ``` +/// +/// **Configuration options** +/// +/// [applyMigrations] Whether pending migrations should be applied when starting Serverpod. Defaults to `true` +/// +/// [enableSessionLogging] Whether session logging should be enabled. Defaults to `false` +/// +/// [rollbackDatabase] Options for when to rollback the database during the test lifecycle. +/// By default `withServerpod` does all database operations inside a transaction that is rolled back after each `test` case. +/// Just like the following enum describes, the behavior of the automatic rollbacks can be configured: +/// ```dart +/// /// Options for when to rollback the database during the test lifecycle. +/// enum RollbackDatabase { +/// /// After each test. This is the default. +/// afterEach, +/// +/// /// After all tests. +/// afterAll, +/// +/// /// Disable rolling back the database. +/// disabled, +/// } +/// ``` +/// +/// [runMode] The run mode that Serverpod should be running in. Defaults to `test`. +/// +/// [serverpodLoggingMode] The logging mode used when creating Serverpod. Defaults to `ServerpodLoggingMode.normal` +/// +/// [serverpodStartTimeout] The timeout to use when starting Serverpod, which connects to the database among other things. Defaults to `Duration(seconds: 30)`. +/// +/// [testGroupTagsOverride] By default Serverpod test tools tags the `withServerpod` test group with `"integration"`. +/// This is to provide a simple way to only run unit or integration tests. +/// This property allows this tag to be overridden to something else. Defaults to `['integration']`. +/// +/// [experimentalFeatures] Optionally specify experimental features. See [Serverpod] for more information. +@_i1.isTestGroup +void withServerpod( + String testGroupName, + _i1.TestClosure testClosure, { + bool? applyMigrations, + bool? enableSessionLogging, + _i2.ExperimentalFeatures? experimentalFeatures, + _i1.RollbackDatabase? rollbackDatabase, + String? runMode, + _i2.RuntimeParametersListBuilder? runtimeParametersBuilder, + _i2.ServerpodLoggingMode? serverpodLoggingMode, + Duration? serverpodStartTimeout, + List? testGroupTagsOverride, +}) { + _i1.buildWithServerpod<_InternalTestEndpoints>( + testGroupName, + _i1.TestServerpod( + testEndpoints: _InternalTestEndpoints(), + endpoints: Endpoints(), + serializationManager: Protocol(), + runMode: runMode, + applyMigrations: applyMigrations, + isDatabaseEnabled: true, + serverpodLoggingMode: serverpodLoggingMode, + experimentalFeatures: experimentalFeatures, + runtimeParametersBuilder: runtimeParametersBuilder, + ), + maybeRollbackDatabase: rollbackDatabase, + maybeEnableSessionLogging: enableSessionLogging, + maybeTestGroupTagsOverride: testGroupTagsOverride, + maybeServerpodStartTimeout: serverpodStartTimeout, + )(testClosure); +} + +class TestEndpoints { + late final _HealthEndpoint health; + + late final _QuoteEndpoint quote; + + late final _VotesEndpoint votes; +} + +class _InternalTestEndpoints extends TestEndpoints + implements _i1.InternalTestEndpoints { + @override + void initialize( + _i2.SerializationManager serializationManager, + _i2.EndpointDispatch endpoints, + ) { + health = _HealthEndpoint( + endpoints, + serializationManager, + ); + quote = _QuoteEndpoint( + endpoints, + serializationManager, + ); + votes = _VotesEndpoint( + endpoints, + serializationManager, + ); + } +} + +class _HealthEndpoint { + _HealthEndpoint( + this._endpointDispatch, + this._serializationManager, + ); + + final _i2.EndpointDispatch _endpointDispatch; + + final _i2.SerializationManager _serializationManager; + + _i3.Future<_i4.Health> ping( + _i1.TestSessionBuilder sessionBuilder, { + String? note, + }) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'health', + method: 'ping', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'health', + methodName: 'ping', + parameters: _i1.testObjectToJson({'note': note}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future<_i4.Health>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future> all( + _i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'health', + method: 'all', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'health', + methodName: 'all', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } +} + +class _QuoteEndpoint { + _QuoteEndpoint( + this._endpointDispatch, + this._serializationManager, + ); + + final _i2.EndpointDispatch _endpointDispatch; + + final _i2.SerializationManager _serializationManager; + + _i3.Future<_i5.Quote> createQuote( + _i1.TestSessionBuilder sessionBuilder, + _i6.CreateQuoteRequest req, + ) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'quote', + method: 'createQuote', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'quote', + methodName: 'createQuote', + parameters: _i1.testObjectToJson({'req': req}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future<_i5.Quote>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future updateQuote( + _i1.TestSessionBuilder sessionBuilder, + _i5.Quote quote, + ) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'quote', + method: 'updateQuote', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'quote', + methodName: 'updateQuote', + parameters: _i1.testObjectToJson({'quote': quote}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future> getAllQuotes( + _i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'quote', + method: 'getAllQuotes', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'quote', + methodName: 'getAllQuotes', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Stream<_i5.Quote> streamAllQuotes( + _i1.TestSessionBuilder sessionBuilder, { + required int limit, + }) { + var _localTestStreamManager = _i1.TestStreamManager<_i5.Quote>(); + _i1.callStreamFunctionAndHandleExceptions( + () async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'quote', + method: 'streamAllQuotes', + ); + var _localCallContext = + await _endpointDispatch.getMethodStreamCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'quote', + methodName: 'streamAllQuotes', + arguments: {'limit': limit}, + requestedInputStreams: [], + serializationManager: _serializationManager, + ); + await _localTestStreamManager.callStreamMethod( + _localCallContext, + _localUniqueSession, + {}, + ); + }, + _localTestStreamManager.outputStreamController, + ); + return _localTestStreamManager.outputStreamController.stream; + } +} + +class _VotesEndpoint { + _VotesEndpoint( + this._endpointDispatch, + this._serializationManager, + ); + + final _i2.EndpointDispatch _endpointDispatch; + + final _i2.SerializationManager _serializationManager; + + _i3.Future> getAllVotes( + _i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'votes', + method: 'getAllVotes', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'votes', + methodName: 'getAllVotes', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future>); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future createVote(_i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'votes', + method: 'createVote', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'votes', + methodName: 'createVote', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } + + _i3.Future sayHello(_i1.TestSessionBuilder sessionBuilder) async { + return _i1.callAwaitableFunctionAndHandleExceptions(() async { + var _localUniqueSession = + (sessionBuilder as _i1.InternalTestSessionBuilder).internalBuild( + endpoint: 'votes', + method: 'sayHello', + ); + try { + var _localCallContext = await _endpointDispatch.getMethodCallContext( + createSessionCallback: (_) => _localUniqueSession, + endpointPath: 'votes', + methodName: 'sayHello', + parameters: _i1.testObjectToJson({}), + serializationManager: _serializationManager, + ); + var _localReturnValue = await (_localCallContext.method.call( + _localUniqueSession, + _localCallContext.arguments, + ) as _i3.Future); + return _localReturnValue; + } finally { + await _localUniqueSession.close(); + } + }); + } +} diff --git a/wien_talks/wien_talks_server/web/static/css/style.css b/wien_talks/wien_talks_server/web/static/css/style.css new file mode 100644 index 0000000..2cea817 --- /dev/null +++ b/wien_talks/wien_talks_server/web/static/css/style.css @@ -0,0 +1,76 @@ +html { + box-sizing: border-box; + font-size: 14px; + font-family: Arial, Helvetica, sans-serif; + background: url('/images/background.svg') no-repeat center center fixed; + -webkit-background-size: cover; + -moz-background-size: cover; + -o-background-size: cover; + background-size: cover; +} + +*, *:before, *:after { + box-sizing: inherit; +} + +body, h1, h2, h3, h4, h5, h6, p, ol, ul { + margin: 0; + padding: 0; + font-weight: normal; +} + +ol, ul { + list-style: none; +} + +img { + max-width: 100%; + height: auto; +} + +body { + padding: 16px; +} + +hr { + margin-top: 16px; margin-bottom: 16px; + border: 0; + height: 1px; + background: #999; +} + +.content { + min-width: 300px; + position: absolute; + left: 50%; + top: 50%; + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); + background-color: white; + border-radius: 8px; + padding: 16px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); +} + +.logo-box a { + text-decoration: none; + font-weight: bold; + color: #666; +} + +.logo-box { + text-align: center; +} + +.info-box p { + margin-top: 2px; +} + +.link-box { + text-align: center; + color: #999; +} + +.link-box a { + text-decoration: none; +} \ No newline at end of file diff --git a/wien_talks/wien_talks_server/web/static/images/background.svg b/wien_talks/wien_talks_server/web/static/images/background.svg new file mode 100644 index 0000000..45ce11d --- /dev/null +++ b/wien_talks/wien_talks_server/web/static/images/background.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg b/wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg new file mode 100644 index 0000000..1872447 --- /dev/null +++ b/wien_talks/wien_talks_server/web/static/images/serverpod-logo.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wien_talks/wien_talks_server/web/templates/built_with_serverpod.html b/wien_talks/wien_talks_server/web/templates/built_with_serverpod.html new file mode 100644 index 0000000..b7a43f5 --- /dev/null +++ b/wien_talks/wien_talks_server/web/templates/built_with_serverpod.html @@ -0,0 +1,29 @@ + + + + + Built with Serverpod + + + +
+ +
+
+

Served at: {{served}}

+

Run mode: {{runmode}}

+
+
+ +
+ + \ No newline at end of file