diff --git a/.github/workflows/deployment-gcp.yml b/.github/workflows/deployment-gcp.yml new file mode 100644 index 0000000..1fb383b --- /dev/null +++ b/.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: pixorama_server + shell: bash + env: + SERVERPOD_PASSWORDS: ${{ secrets.SERVERPOD_PASSWORDS }} + run: | + pwd + echo "$SERVERPOD_PASSWORDS" > config/passwords.yaml + ls config/ + + - name: Configure Docker + working-directory: pixorama_server + run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev + + - name: Build the Docker image + working-directory: pixorama_server + run: "docker build -t $IMAGE_NAME ." + + - name: Tag the Docker image + working-directory: pixorama_server + run: docker tag $IMAGE_NAME ${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT }}/${{ env.REPOSITORY }}/$IMAGE_NAME + + - name: Push Docker image + working-directory: pixorama_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/README.md b/README.md index 92bbf1b..436c83a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ For full Serverpod documentation, please visit ## Server code On the server side there are three main files that makes Pixorama tick. Two -serializable objects, found in the [protocol](pixorama_server/lib/src/protocol) +serializable objects, found in the [generated](pixorama_server/lib/src/generated) directory and the [PixoramaEndpoint](pixorama_server/lib/src/endpoints/pixorama_endpoint.dart) class. Those files are great starting points for understanding how Pixorama @@ -26,45 +26,14 @@ Next, you need to setup the Docker container and Serverpod & Pixorama database t ```bash cd pixorama_server -serverpod generate docker compose up --build --detach -docker compose exec -T postgres env PGPASSWORD="PASSWORD" psql -h postgres -U postgres -d pixorama < generated/tables-serverpod.pgsql -docker compose exec -T postgres env PGPASSWORD="PASSWORD" psql -h postgres -U postgres -d pixorama < generated/tables.pgsql -``` -The first docker compose exec commands should return numerous sql verifications like: -```bash -CREATE TABLE -ALTER TABLE -CREATE INDEX -CREATE TABLE -ALTER TABLE -CREATE INDEX -CREATE INDEX -... -. -. -CREATE INDEX -ALTER TABLE -``` - -The second docker compose exec commands should return two sql verifications like: -```bash -CREATE TABLE -ALTER TABLE -``` -This version of Pixorama runs the serverpod locally from the vendor directory, and postgres and redis are run within Docker containers. - -```bash -cd vendor -git clone https://github.com/serverpod/serverpod.git -cd .. ``` -Next, fetch packages for serverpod. +Next, run migrations by typing: ```bash -dart pub get +dart bin/main.dart --role maintenance ``` Finally, start the server by typing: @@ -73,16 +42,16 @@ Finally, start the server by typing: dart bin/main.dart ``` -In another window, go to pixorama_flutter and modify the `lib/main.dart` file to use the local server url instead of the live app server. Then type: +In another window, go to pixorama_flutter and then type: ```bash -flutter run +flutter run -d chrome ``` -The debugger will open chrome and the server will return the following screen. +Flutter will open Chrome and start the Pixorama app. image -Select a color from the pallete on the right side, then click on a location in the square to the left. The pixel color should change. Open several chrome tabs with the same url as that opened by the flutter debugger. Changing a pixel in one window should update all the other the images in the other browser windows, as shown below. +Select a color from the pallete on the right side, then click on a location in the pixel canvas to the left. The pixel color should change. Open several chrome windows with the same url as that opened by the flutter debugger. Changing a pixel in one window should update all the other the images in the other browser windows, as shown below. image diff --git a/pixorama_client/dartdoc_options.yaml b/pixorama_client/dartdoc_options.yaml new file mode 100644 index 0000000..035db99 --- /dev/null +++ b/pixorama_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/pixorama_client/doc/endpoint.md b/pixorama_client/doc/endpoint.md new file mode 100644 index 0000000..92a8734 --- /dev/null +++ b/pixorama_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 ExampleEndpoint. +client.example.hello("world!"); + +// Generic format. +client..(...); +``` + +Please see the full official documentation [here](https://docs.serverpod.dev) diff --git a/pixorama_client/lib/src/protocol/client.dart b/pixorama_client/lib/src/protocol/client.dart index 3b61a8c..ddb636f 100644 --- a/pixorama_client/lib/src/protocol/client.dart +++ b/pixorama_client/lib/src/protocol/client.dart @@ -4,19 +4,21 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_client/serverpod_client.dart' as _i1; -import 'dart:io' as _i2; -import 'protocol.dart' as _i3; +import 'protocol.dart' as _i2; /// The Pixorama endpoint handles all communication related to keeping clients /// up-to-date with the latest version of the pixel image. When a client first /// connects, it is sent a full version of the image with the ImageData message. /// Whenever a pixel is being edited by a client, we store the edit in the /// _pixelData array and pass on the changes to all connected clients. -class _EndpointPixorama extends _i1.EndpointRef { - _EndpointPixorama(_i1.EndpointCaller caller) : super(caller); +/// {@category Endpoint} +class EndpointPixorama extends _i1.EndpointRef { + EndpointPixorama(_i1.EndpointCaller caller) : super(caller); @override String get name => 'pixorama'; @@ -25,21 +27,26 @@ class _EndpointPixorama extends _i1.EndpointRef { class Client extends _i1.ServerpodClient { Client( String host, { - _i2.SecurityContext? context, + dynamic securityContext, _i1.AuthenticationKeyManager? authenticationKeyManager, + Duration? streamingConnectionTimeout, + Duration? connectionTimeout, }) : super( host, - _i3.Protocol(), - context: context, + _i2.Protocol(), + securityContext: securityContext, authenticationKeyManager: authenticationKeyManager, + streamingConnectionTimeout: streamingConnectionTimeout, + connectionTimeout: connectionTimeout, ) { - pixorama = _EndpointPixorama(this); + pixorama = EndpointPixorama(this); } - late final _EndpointPixorama pixorama; + late final EndpointPixorama pixorama; @override Map get endpointRefLookup => {'pixorama': pixorama}; + @override Map get moduleLookup => {}; } diff --git a/pixorama_client/lib/src/protocol/image_data.dart b/pixorama_client/lib/src/protocol/image_data.dart index 2e0d480..dbdf32c 100644 --- a/pixorama_client/lib/src/protocol/image_data.dart +++ b/pixorama_client/lib/src/protocol/image_data.dart @@ -4,19 +4,28 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_client/serverpod_client.dart' as _i1; import 'dart:typed_data' as _i2; -class ImageData extends _i1.SerializableEntity { - ImageData({ +abstract class ImageData extends _i1.SerializableEntity { + ImageData._({ this.id, required this.pixels, required this.width, required this.height, }); + factory ImageData({ + int? id, + required _i2.ByteData pixels, + required int width, + required int height, + }) = _ImageDataImpl; + factory ImageData.fromJson( Map jsonSerialization, _i1.SerializationManager serializationManager, @@ -31,6 +40,9 @@ class ImageData extends _i1.SerializableEntity { ); } + /// 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; _i2.ByteData pixels; @@ -39,13 +51,50 @@ class ImageData extends _i1.SerializableEntity { int height; + ImageData copyWith({ + int? id, + _i2.ByteData? pixels, + int? width, + int? height, + }); @override Map toJson() { return { - 'id': id, - 'pixels': pixels, + if (id != null) 'id': id, + 'pixels': pixels.toJson(), 'width': width, 'height': height, }; } } + +class _Undefined {} + +class _ImageDataImpl extends ImageData { + _ImageDataImpl({ + int? id, + required _i2.ByteData pixels, + required int width, + required int height, + }) : super._( + id: id, + pixels: pixels, + width: width, + height: height, + ); + + @override + ImageData copyWith({ + Object? id = _Undefined, + _i2.ByteData? pixels, + int? width, + int? height, + }) { + return ImageData( + id: id is int? ? id : this.id, + pixels: pixels ?? this.pixels.clone(), + width: width ?? this.width, + height: height ?? this.height, + ); + } +} diff --git a/pixorama_client/lib/src/protocol/image_update.dart b/pixorama_client/lib/src/protocol/image_update.dart index 91ec237..8bc57b2 100644 --- a/pixorama_client/lib/src/protocol/image_update.dart +++ b/pixorama_client/lib/src/protocol/image_update.dart @@ -4,16 +4,23 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod_client/serverpod_client.dart' as _i1; -class ImageUpdate extends _i1.SerializableEntity { - ImageUpdate({ +abstract class ImageUpdate extends _i1.SerializableEntity { + ImageUpdate._({ required this.pixelIndex, required this.colorIndex, }); + factory ImageUpdate({ + required int pixelIndex, + required int colorIndex, + }) = _ImageUpdateImpl; + factory ImageUpdate.fromJson( Map jsonSerialization, _i1.SerializationManager serializationManager, @@ -30,6 +37,10 @@ class ImageUpdate extends _i1.SerializableEntity { int colorIndex; + ImageUpdate copyWith({ + int? pixelIndex, + int? colorIndex, + }); @override Map toJson() { return { @@ -38,3 +49,24 @@ class ImageUpdate extends _i1.SerializableEntity { }; } } + +class _ImageUpdateImpl extends ImageUpdate { + _ImageUpdateImpl({ + required int pixelIndex, + required int colorIndex, + }) : super._( + pixelIndex: pixelIndex, + colorIndex: colorIndex, + ); + + @override + ImageUpdate copyWith({ + int? pixelIndex, + int? colorIndex, + }) { + return ImageUpdate( + pixelIndex: pixelIndex ?? this.pixelIndex, + colorIndex: colorIndex ?? this.colorIndex, + ); + } +} diff --git a/pixorama_client/lib/src/protocol/protocol.dart b/pixorama_client/lib/src/protocol/protocol.dart index 64cbefa..0b5aa56 100644 --- a/pixorama_client/lib/src/protocol/protocol.dart +++ b/pixorama_client/lib/src/protocol/protocol.dart @@ -4,6 +4,8 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern library protocol; // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -12,7 +14,7 @@ import 'image_data.dart' as _i2; import 'image_update.dart' as _i3; export 'image_data.dart'; export 'image_update.dart'; -export 'client.dart'; // ignore_for_file: equal_keys_in_map +export 'client.dart'; class Protocol extends _i1.SerializationManager { Protocol._(); diff --git a/pixorama_client/pubspec.yaml b/pixorama_client/pubspec.yaml index f18a31b..2bad9b3 100644 --- a/pixorama_client/pubspec.yaml +++ b/pixorama_client/pubspec.yaml @@ -2,8 +2,7 @@ name: pixorama_client description: Starting point for a Serverpod client. environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=3.0.0 <4.0.0' dependencies: - serverpod_client: - path: ../vendor/serverpod/packages/serverpod_client + serverpod_client: 1.2.4 diff --git a/pixorama_flutter/.metadata b/pixorama_flutter/.metadata index e27f5cc..d22992e 100644 --- a/pixorama_flutter/.metadata +++ b/pixorama_flutter/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - channel: stable + revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a" + channel: "stable" project_type: app @@ -13,26 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: android - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: ios - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: linux - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: macos - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: web - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a - platform: windows - create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 - base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1 + create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a + base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a # User provided section diff --git a/pixorama_flutter/lib/main.dart b/pixorama_flutter/lib/main.dart index 44e1f56..406ffce 100644 --- a/pixorama_flutter/lib/main.dart +++ b/pixorama_flutter/lib/main.dart @@ -5,20 +5,22 @@ import 'package:pixorama_flutter/src/pixorama/pixorama.dart'; import 'package:serverpod_flutter/serverpod_flutter.dart'; import 'package:url_strategy/url_strategy.dart'; -// Change this to use the live server or to connect to a local server. -var client = Client('https://api.pixorama.live/'); -// var client = Client('http://localhost:8080/'); +// Sets up a singleton client object that can be used to talk to the server from +// anywhere in our app. The client is generated from your server code. +// The client is set up to connect to a Serverpod running on a local server on +// the default port. You will need to modify this to connect to staging or +// production servers. +var client = Client('http://$localhost:8080/'); void main() { client.connectivityMonitor = FlutterConnectivityMonitor(); - // Hide that pesky /#/ in the URL for web app. setPathUrlStrategy(); runApp(const PixoramaApp()); } class PixoramaApp extends StatelessWidget { - const PixoramaApp({Key? key}) : super(key: key); + const PixoramaApp({super.key}); @override Widget build(BuildContext context) { diff --git a/pixorama_flutter/lib/src/pixorama/connection_display.dart b/pixorama_flutter/lib/src/pixorama/connection_display.dart index 2e1f19d..5f58004 100644 --- a/pixorama_flutter/lib/src/pixorama/connection_display.dart +++ b/pixorama_flutter/lib/src/pixorama/connection_display.dart @@ -30,8 +30,7 @@ class ConnectionDisplay extends StatelessWidget { connectionStateColor = Colors.red; break; case StreamingConnectionStatus.waitingToRetry: - connectionStateDescription = - 'Retrying in ${connectionState.retryInSeconds} seconds'; + connectionStateDescription = 'Retrying in ${connectionState.retryInSeconds} seconds'; connectionStateColor = Colors.orange[800]!; break; } diff --git a/pixorama_flutter/linux/CMakeLists.txt b/pixorama_flutter/linux/CMakeLists.txt index 381e4d6..b828aa8 100644 --- a/pixorama_flutter/linux/CMakeLists.txt +++ b/pixorama_flutter/linux/CMakeLists.txt @@ -86,6 +86,7 @@ set_target_properties(${BINARY_NAME} RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" ) + # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) @@ -122,6 +123,12 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) COMPONENT Runtime) endforeach(bundled_library) +# Copy the native assets provided by the build.dart from all packages. +set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/") +install(DIRECTORY "${NATIVE_ASSETS_DIR}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") diff --git a/pixorama_flutter/pubspec.lock b/pixorama_flutter/pubspec.lock index 2fe98bd..8ba6134 100644 --- a/pixorama_flutter/pubspec.lock +++ b/pixorama_flutter/pubspec.lock @@ -1,125 +1,134 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + archive: + dependency: transitive + description: + name: archive + sha256: "22600aa1e926be775fa5fe7e6894e7fb3df9efda8891c73f70fb3262399a432d" + url: "https://pub.dev" + source: hosted + version: "3.4.10" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" connectivity_plus: dependency: transitive description: name: connectivity_plus - url: "https://pub.dartlang.org" + sha256: "224a77051d52a11fbad53dd57827594d3bd24f945af28bd70bab376d68d437f0" + url: "https://pub.dev" source: hosted - version: "2.3.7" - connectivity_plus_linux: - dependency: transitive - description: - name: connectivity_plus_linux - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - connectivity_plus_macos: - dependency: transitive - description: - name: connectivity_plus_macos - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.4" + version: "5.0.2" connectivity_plus_platform_interface: dependency: transitive description: name: connectivity_plus_platform_interface - url: "https://pub.dartlang.org" + sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + url: "https://pub.dev" source: hosted - version: "1.2.1" - connectivity_plus_web: - dependency: transitive - description: - name: connectivity_plus_web - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.3" - connectivity_plus_windows: + version: "1.2.4" + convert: dependency: transitive description: - name: connectivity_plus_windows - url: "https://pub.dartlang.org" + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "3.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d + url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.6" dbus: dependency: transitive description: name: dbus - url: "https://pub.dartlang.org" + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" source: hosted - version: "0.7.8" + version: "0.7.10" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -129,9 +138,18 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" + url: "https://pub.dev" + source: hosted + version: "2.0.10+1" flutter_test: dependency: "direct dev" description: flutter @@ -146,84 +164,136 @@ packages: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "1.2.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.2" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.7" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + url: "https://pub.dev" + source: hosted + version: "2.0.1" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + lottie: + dependency: transitive + description: + name: lottie + sha256: a93542cc2d60a7057255405f62252533f8e8956e7e06754955669fd32fb4b216 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.7.0" made_with_serverpod: dependency: "direct main" description: name: made_with_serverpod - url: "https://pub.dartlang.org" + sha256: "9f4bf2e1108cabc272b93d7b8dca586a526f771103449e2e9d86187c07ee593c" + url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.1.0" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.8.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.11.0" nm: dependency: transitive description: name: nm - url: "https://pub.dartlang.org" + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" source: hosted version: "0.5.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.2" pixels: dependency: "direct main" description: name: pixels - url: "https://pub.dartlang.org" + sha256: "831a6a5a40ad1689ae41ce90cf48eb0bfbe21c5c14cd65410ed1167621d5016d" + url: "https://pub.dev" source: hosted version: "1.0.1" pixorama_client: @@ -237,30 +307,42 @@ packages: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.8" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29" + url: "https://pub.dev" + source: hosted + version: "3.7.4" serverpod_client: dependency: transitive description: - path: "../vendor/serverpod/packages/serverpod_client" - relative: true - source: path - version: "0.9.20" + name: serverpod_client + sha256: "6e76c50d8aa5c7f796dd0af8307355740db01291931ab1fca5971505497e9547" + url: "https://pub.dev" + source: hosted + version: "1.2.4" serverpod_flutter: dependency: "direct main" description: - path: "../vendor/serverpod/packages/serverpod_flutter" - relative: true - source: path - version: "0.9.20" + name: serverpod_flutter + sha256: fed5a2421c71c99afdafa4d2b9386667041fd29661b76c5f385a5d19654a0e00 + url: "https://pub.dev" + source: hosted + version: "1.2.4" serverpod_serialization: dependency: transitive description: - path: "../vendor/serverpod/packages/serverpod_serialization" - relative: true - source: path - version: "0.9.20" + name: serverpod_serialization + sha256: "295695cfcf5641bd38bd5c56dd322a9e1f6e2462bc2a539913e7e2d9ef6a6c0c" + url: "https://pub.dev" + source: hosted + version: "1.2.4" sky_engine: dependency: transitive description: flutter @@ -270,142 +352,218 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.10.0" + 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 - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.6.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" url_launcher: dependency: transitive description: name: url_launcher - url: "https://pub.dartlang.org" + sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e" + url: "https://pub.dev" source: hosted - version: "6.1.6" + version: "6.2.5" url_launcher_android: dependency: transitive description: name: url_launcher_android - url: "https://pub.dartlang.org" + sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745 + url: "https://pub.dev" source: hosted - version: "6.0.19" + version: "6.3.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - url: "https://pub.dartlang.org" + sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5" + url: "https://pub.dev" source: hosted - version: "6.0.17" + version: "6.2.5" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d" + url: "https://pub.dev" source: hosted - version: "2.0.13" + version: "2.3.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.1" url_strategy: dependency: "direct main" description: name: url_strategy - url: "https://pub.dartlang.org" + sha256: "42b68b42a9864c4d710401add17ad06e28f1c1d5500c93b98c431f6b0ea4ab87" + url: "https://pub.dev" source: hosted version: "0.2.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 + url: "https://pub.dev" + source: hosted + version: "4.3.3" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" + url: "https://pub.dev" + source: hosted + version: "1.1.11+1" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.4" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.5.0" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" sdks: - dart: ">=2.18.1 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/pixorama_flutter/pubspec.yaml b/pixorama_flutter/pubspec.yaml index c9807ce..f9fbf64 100644 --- a/pixorama_flutter/pubspec.yaml +++ b/pixorama_flutter/pubspec.yaml @@ -18,26 +18,26 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: flutter: sdk: flutter - made_with_serverpod: ^1.0.0 - pixels: ^1.0.1 + serverpod_flutter: 1.2.4 pixorama_client: path: ../pixorama_client - serverpod_flutter: - path: ../vendor/serverpod/packages/serverpod_flutter - url_strategy: ^0.2.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.5 + url_strategy: ^0.2.0 + made_with_serverpod: ^1.1.0 + pixels: ^1.0.1 dev_dependencies: - flutter_lints: ^2.0.1 + flutter_lints: ^3.0.0 flutter_test: sdk: flutter diff --git a/pixorama_server/.gcloudignore b/pixorama_server/.gcloudignore new file mode 100644 index 0000000..3d64647 --- /dev/null +++ b/pixorama_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/pixorama_server/.gitignore b/pixorama_server/.gitignore index 3d64647..22709d2 100644 --- a/pixorama_server/.gitignore +++ b/pixorama_server/.gitignore @@ -7,3 +7,7 @@ build/ # Directory created by dartdoc doc/api/ + +# Passwords file +# This password file is needed to run the server locally +# config/passwords.yaml diff --git a/pixorama_server/Dockerfile b/pixorama_server/Dockerfile new file mode 100644 index 0000000..0710dca --- /dev/null +++ b/pixorama_server/Dockerfile @@ -0,0 +1,29 @@ +# If you update the dart version, make sure the image is +# compatible with the busybox image. +FROM dart:3.2.5 AS build + +WORKDIR /app +COPY . . + +RUN dart pub get +RUN dart compile exe bin/main.dart -o bin/main + +# If you update the busybox version, make sure the image is +# compatible with the dart image. +FROM busybox:1.36.1-glibc + +ENV runmode=development +ENV serverid=default +ENV logging=normal +ENV role=monolith + +COPY --from=build /runtime/ / +COPY --from=build /app/bin/main /app/bin/main +COPY --from=build /app/config/ config/ +COPY --from=build /app/web/ web/ + +EXPOSE 8080 +EXPOSE 8081 +EXPOSE 8082 + +CMD app/bin/main --mode $runmode --server-id $serverid --logging $logging --role $role diff --git a/pixorama_server/aws/scripts/appspec.yml b/pixorama_server/deploy/aws/scripts/appspec.yml similarity index 100% rename from pixorama_server/aws/scripts/appspec.yml rename to pixorama_server/deploy/aws/scripts/appspec.yml diff --git a/pixorama_server/aws/scripts/install_dependencies b/pixorama_server/deploy/aws/scripts/install_dependencies similarity index 100% rename from pixorama_server/aws/scripts/install_dependencies rename to pixorama_server/deploy/aws/scripts/install_dependencies diff --git a/pixorama_server/aws/scripts/run_serverpod b/pixorama_server/deploy/aws/scripts/run_serverpod similarity index 100% rename from pixorama_server/aws/scripts/run_serverpod rename to pixorama_server/deploy/aws/scripts/run_serverpod diff --git a/pixorama_server/aws/scripts/start_server b/pixorama_server/deploy/aws/scripts/start_server similarity index 100% rename from pixorama_server/aws/scripts/start_server rename to pixorama_server/deploy/aws/scripts/start_server diff --git a/pixorama_server/aws/terraform/.gitignore b/pixorama_server/deploy/aws/terraform/.gitignore similarity index 100% rename from pixorama_server/aws/terraform/.gitignore rename to pixorama_server/deploy/aws/terraform/.gitignore diff --git a/pixorama_server/aws/terraform/balancers-staging.tf b/pixorama_server/deploy/aws/terraform/balancers-staging.tf similarity index 100% rename from pixorama_server/aws/terraform/balancers-staging.tf rename to pixorama_server/deploy/aws/terraform/balancers-staging.tf diff --git a/pixorama_server/aws/terraform/balancers.tf b/pixorama_server/deploy/aws/terraform/balancers.tf similarity index 100% rename from pixorama_server/aws/terraform/balancers.tf rename to pixorama_server/deploy/aws/terraform/balancers.tf diff --git a/pixorama_server/aws/terraform/cloudfront-web-staging.tf b/pixorama_server/deploy/aws/terraform/cloudfront-web-staging.tf similarity index 100% rename from pixorama_server/aws/terraform/cloudfront-web-staging.tf rename to pixorama_server/deploy/aws/terraform/cloudfront-web-staging.tf diff --git a/pixorama_server/aws/terraform/cloudfront-web.tf b/pixorama_server/deploy/aws/terraform/cloudfront-web.tf similarity index 100% rename from pixorama_server/aws/terraform/cloudfront-web.tf rename to pixorama_server/deploy/aws/terraform/cloudfront-web.tf diff --git a/pixorama_server/aws/terraform/code-deploy.tf b/pixorama_server/deploy/aws/terraform/code-deploy.tf similarity index 100% rename from pixorama_server/aws/terraform/code-deploy.tf rename to pixorama_server/deploy/aws/terraform/code-deploy.tf diff --git a/pixorama_server/aws/terraform/config.auto.tfvars b/pixorama_server/deploy/aws/terraform/config.auto.tfvars similarity index 100% rename from pixorama_server/aws/terraform/config.auto.tfvars rename to pixorama_server/deploy/aws/terraform/config.auto.tfvars diff --git a/pixorama_server/aws/terraform/database.tf b/pixorama_server/deploy/aws/terraform/database.tf similarity index 100% rename from pixorama_server/aws/terraform/database.tf rename to pixorama_server/deploy/aws/terraform/database.tf diff --git a/pixorama_server/aws/terraform/init-script.sh b/pixorama_server/deploy/aws/terraform/init-script.sh similarity index 100% rename from pixorama_server/aws/terraform/init-script.sh rename to pixorama_server/deploy/aws/terraform/init-script.sh diff --git a/pixorama_server/aws/terraform/instances.tf b/pixorama_server/deploy/aws/terraform/instances.tf similarity index 100% rename from pixorama_server/aws/terraform/instances.tf rename to pixorama_server/deploy/aws/terraform/instances.tf diff --git a/pixorama_server/aws/terraform/main.tf b/pixorama_server/deploy/aws/terraform/main.tf similarity index 100% rename from pixorama_server/aws/terraform/main.tf rename to pixorama_server/deploy/aws/terraform/main.tf diff --git a/pixorama_server/aws/terraform/redis.tf b/pixorama_server/deploy/aws/terraform/redis.tf similarity index 100% rename from pixorama_server/aws/terraform/redis.tf rename to pixorama_server/deploy/aws/terraform/redis.tf diff --git a/pixorama_server/aws/terraform/staging.tf b/pixorama_server/deploy/aws/terraform/staging.tf similarity index 100% rename from pixorama_server/aws/terraform/staging.tf rename to pixorama_server/deploy/aws/terraform/staging.tf diff --git a/pixorama_server/aws/terraform/storage.tf b/pixorama_server/deploy/aws/terraform/storage.tf similarity index 100% rename from pixorama_server/aws/terraform/storage.tf rename to pixorama_server/deploy/aws/terraform/storage.tf diff --git a/pixorama_server/aws/terraform/variables.tf b/pixorama_server/deploy/aws/terraform/variables.tf similarity index 100% rename from pixorama_server/aws/terraform/variables.tf rename to pixorama_server/deploy/aws/terraform/variables.tf diff --git a/pixorama_server/aws/terraform/vpc.tf b/pixorama_server/deploy/aws/terraform/vpc.tf similarity index 100% rename from pixorama_server/aws/terraform/vpc.tf rename to pixorama_server/deploy/aws/terraform/vpc.tf diff --git a/pixorama_server/deploy/gcp/console_gcr/cloud-run-deploy.sh b/pixorama_server/deploy/gcp/console_gcr/cloud-run-deploy.sh new file mode 100644 index 0000000..7f2b13c --- /dev/null +++ b/pixorama_server/deploy/gcp/console_gcr/cloud-run-deploy.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# 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/pixorama_server/deploy/gcp/terraform_gce/.gitignore b/pixorama_server/deploy/gcp/terraform_gce/.gitignore new file mode 100644 index 0000000..e2384b8 --- /dev/null +++ b/pixorama_server/deploy/gcp/terraform_gce/.gitignore @@ -0,0 +1,2 @@ +credentials.json +.terraform diff --git a/pixorama_server/deploy/gcp/terraform_gce/config.auto.tfvars b/pixorama_server/deploy/gcp/terraform_gce/config.auto.tfvars new file mode 100644 index 0000000..dc2b0e1 --- /dev/null +++ b/pixorama_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/pixorama_server/deploy/gcp/terraform_gce/main.tf b/pixorama_server/deploy/gcp/terraform_gce/main.tf new file mode 100644 index 0000000..34f1928 --- /dev/null +++ b/pixorama_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/pixorama_server/deploy/gcp/terraform_gce/variables.tf b/pixorama_server/deploy/gcp/terraform_gce/variables.tf new file mode 100644 index 0000000..ecaab20 --- /dev/null +++ b/pixorama_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 deployning a staging environment)." + type = string +} diff --git a/pixorama_server/generated/tables-serverpod.pgsql b/pixorama_server/generated/tables-serverpod.pgsql deleted file mode 100644 index e8bc404..0000000 --- a/pixorama_server/generated/tables-serverpod.pgsql +++ /dev/null @@ -1,275 +0,0 @@ --- --- Class AuthKey as table serverpod_auth_key --- - -CREATE TABLE "serverpod_auth_key" ( - "id" serial, - "userId" integer NOT NULL, - "hash" text NOT NULL, - "scopeNames" json NOT NULL, - "method" text NOT NULL -); - -ALTER TABLE ONLY "serverpod_auth_key" - ADD CONSTRAINT serverpod_auth_key_pkey PRIMARY KEY (id); - -CREATE INDEX serverpod_auth_key_userId_idx ON "serverpod_auth_key" USING btree ("userId"); - - --- --- Class CloudStorageEntry as table serverpod_cloud_storage --- - -CREATE TABLE "serverpod_cloud_storage" ( - "id" serial, - "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 -); - -ALTER TABLE ONLY "serverpod_cloud_storage" - ADD CONSTRAINT serverpod_cloud_storage_pkey PRIMARY KEY (id); - -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" serial, - "storageId" text NOT NULL, - "path" text NOT NULL, - "expiration" timestamp without time zone NOT NULL, - "authKey" text NOT NULL -); - -ALTER TABLE ONLY "serverpod_cloud_storage_direct_upload" - ADD CONSTRAINT serverpod_cloud_storage_direct_upload_pkey PRIMARY KEY (id); - -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" serial, - "name" text NOT NULL, - "time" timestamp without time zone NOT NULL, - "serializedObject" text, - "serverId" text NOT NULL, - "identifier" text -); - -ALTER TABLE ONLY "serverpod_future_call" - ADD CONSTRAINT serverpod_future_call_pkey PRIMARY KEY (id); - -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" serial, - "serverId" text NOT NULL, - "type" integer NOT NULL, - "timestamp" timestamp without time zone NOT NULL, - "active" integer NOT NULL, - "closing" integer NOT NULL, - "idle" integer NOT NULL -); - -ALTER TABLE ONLY "serverpod_health_connection_info" - ADD CONSTRAINT serverpod_health_connection_info_pkey PRIMARY KEY (id); - -CREATE UNIQUE INDEX serverpod_health_connection_info_timestamp_idx ON "serverpod_health_connection_info" USING btree ("timestamp", "serverId", "type"); - - --- --- Class ServerHealthMetric as table serverpod_health_metric --- - -CREATE TABLE "serverpod_health_metric" ( - "id" serial, - "name" text NOT NULL, - "serverId" text NOT NULL, - "timestamp" timestamp without time zone NOT NULL, - "isHealthy" boolean NOT NULL, - "value" double precision NOT NULL -); - -ALTER TABLE ONLY "serverpod_health_metric" - ADD CONSTRAINT serverpod_health_metric_pkey PRIMARY KEY (id); - -CREATE UNIQUE INDEX serverpod_health_metric_timestamp_idx ON "serverpod_health_metric" USING btree ("timestamp", "serverId", "name"); - - --- --- Class MethodInfo as table serverpod_method --- - -CREATE TABLE "serverpod_method" ( - "id" serial, - "endpoint" text NOT NULL, - "method" text NOT NULL -); - -ALTER TABLE ONLY "serverpod_method" - ADD CONSTRAINT serverpod_method_pkey PRIMARY KEY (id); - -CREATE UNIQUE INDEX serverpod_method_endpoint_method_idx ON "serverpod_method" USING btree ("endpoint", "method"); - - --- --- Class ReadWriteTestEntry as table serverpod_readwrite_test --- - -CREATE TABLE "serverpod_readwrite_test" ( - "id" serial, - "number" integer NOT NULL -); - -ALTER TABLE ONLY "serverpod_readwrite_test" - ADD CONSTRAINT serverpod_readwrite_test_pkey PRIMARY KEY (id); - - --- --- Class RuntimeSettings as table serverpod_runtime_settings --- - -CREATE TABLE "serverpod_runtime_settings" ( - "id" serial, - "logSettings" json NOT NULL, - "logSettingsOverrides" json NOT NULL, - "logServiceCalls" boolean NOT NULL, - "logMalformedCalls" boolean NOT NULL -); - -ALTER TABLE ONLY "serverpod_runtime_settings" - ADD CONSTRAINT serverpod_runtime_settings_pkey PRIMARY KEY (id); - - --- --- Class SessionLogEntry as table serverpod_session_log --- - -CREATE TABLE "serverpod_session_log" ( - "id" serial, - "serverId" text NOT NULL, - "time" timestamp without time zone NOT NULL, - "module" text, - "endpoint" text, - "method" text, - "duration" double precision, - "numQueries" integer, - "slow" boolean, - "error" text, - "stackTrace" text, - "authenticatedUserId" integer, - "isOpen" boolean, - "touched" timestamp without time zone NOT NULL -); - -ALTER TABLE ONLY "serverpod_session_log" - ADD CONSTRAINT serverpod_session_log_pkey PRIMARY KEY (id); - -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 QueryLogEntry as table serverpod_query_log --- - -CREATE TABLE "serverpod_query_log" ( - "id" serial, - "serverId" text NOT NULL, - "sessionLogId" integer NOT NULL, - "messageId" integer, - "query" text NOT NULL, - "duration" double precision NOT NULL, - "numRows" integer, - "error" text, - "stackTrace" text, - "slow" boolean NOT NULL, - "order" integer NOT NULL -); - -ALTER TABLE ONLY "serverpod_query_log" - ADD CONSTRAINT serverpod_query_log_pkey PRIMARY KEY (id); - -CREATE INDEX serverpod_query_log_sessionLogId_idx ON "serverpod_query_log" USING btree ("sessionLogId"); - -ALTER TABLE ONLY "serverpod_query_log" - ADD CONSTRAINT serverpod_query_log_fk_0 - FOREIGN KEY("sessionLogId") - REFERENCES serverpod_session_log(id) - ON DELETE CASCADE; - --- --- Class MessageLogEntry as table serverpod_message_log --- - -CREATE TABLE "serverpod_message_log" ( - "id" serial, - "sessionLogId" integer NOT NULL, - "serverId" text NOT NULL, - "messageId" integer NOT NULL, - "endpoint" text NOT NULL, - "messageName" text NOT NULL, - "duration" double precision NOT NULL, - "error" text, - "stackTrace" text, - "slow" boolean NOT NULL, - "order" integer NOT NULL -); - -ALTER TABLE ONLY "serverpod_message_log" - ADD CONSTRAINT serverpod_message_log_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY "serverpod_message_log" - ADD CONSTRAINT serverpod_message_log_fk_0 - FOREIGN KEY("sessionLogId") - REFERENCES serverpod_session_log(id) - ON DELETE CASCADE; - --- --- Class LogEntry as table serverpod_log --- - -CREATE TABLE "serverpod_log" ( - "id" serial, - "sessionLogId" integer NOT NULL, - "messageId" integer, - "reference" text, - "serverId" text NOT NULL, - "time" timestamp without time zone NOT NULL, - "logLevel" integer NOT NULL, - "message" text NOT NULL, - "error" text, - "stackTrace" text, - "order" integer NOT NULL -); - -ALTER TABLE ONLY "serverpod_log" - ADD CONSTRAINT serverpod_log_pkey PRIMARY KEY (id); - -CREATE INDEX serverpod_log_sessionLogId_idx ON "serverpod_log" USING btree ("sessionLogId"); - -ALTER TABLE ONLY "serverpod_log" - ADD CONSTRAINT serverpod_log_fk_0 - FOREIGN KEY("sessionLogId") - REFERENCES serverpod_session_log(id) - ON DELETE CASCADE; diff --git a/pixorama_server/generated/tables.pgsql b/pixorama_server/generated/tables.pgsql index 1214ce0..9768697 100644 --- a/pixorama_server/generated/tables.pgsql +++ b/pixorama_server/generated/tables.pgsql @@ -1,15 +1,11 @@ --- --- Class ImageData as table image_data --- +/* +This file is no longer used. Version 1.2.0 and above use the new migration +system to manage the database schema. -CREATE TABLE "image_data" ( - "id" serial, - "pixels" bytea NOT NULL, - "width" integer NOT NULL, - "height" integer NOT NULL -); - -ALTER TABLE ONLY "image_data" - ADD CONSTRAINT image_data_pkey PRIMARY KEY (id); +Run "serverpod create-migration" to create a new migration. +Run "dart bin/main.dart --role maintenance --apply-migrations" to apply the migration. +See the official documentation for more information: +https://docs.serverpod.dev/concepts/database/migrations +*/ \ No newline at end of file diff --git a/pixorama_server/lib/src/endpoints/pixorama_endpoint.dart b/pixorama_server/lib/src/endpoints/pixorama_endpoint.dart index 1e1cb6a..1742c01 100644 --- a/pixorama_server/lib/src/endpoints/pixorama_endpoint.dart +++ b/pixorama_server/lib/src/endpoints/pixorama_endpoint.dart @@ -62,11 +62,11 @@ class PixoramaEndpoint extends Endpoint { // manually create a new session. If you create a session, you are also // responsible to close it when you are done, or it could lead to memory // leaks within your server. - var session = await Serverpod.instance!.createSession(enableLogging: true); + var session = await Serverpod.instance.createSession(enableLogging: true); try { // Fetch the image data that we want to update. If there is no data in the // database already, we create a new row for the image data. - var imageData = await ImageData.findSingleRow(session); + var imageData = await ImageData.db.findFirstRow(session); if (imageData == null) { // Create a new ImageData row in the database. imageData = ImageData( @@ -74,11 +74,11 @@ class PixoramaEndpoint extends Endpoint { width: _imageWidth, height: _imageHeight, ); - await ImageData.insert(session, imageData); + await ImageData.db.insertRow(session, imageData); } else { // Update the existing entry. imageData.pixels = _pixelData.buffer.asByteData(); - await ImageData.update(session, imageData); + await ImageData.db.updateRow(session, imageData); } } catch (e, stackTrace) { // If we finish with an error, we should close the session with the error @@ -92,10 +92,10 @@ class PixoramaEndpoint extends Endpoint { /// Loads the pixel image from the database. static Future loadImageFromDatabase() async { - var session = await Serverpod.instance!.createSession(enableLogging: true); + var session = await Serverpod.instance.createSession(enableLogging: true); try { // Load the image data, if it exists. - var imageData = await ImageData.findSingleRow(session); + var imageData = await ImageData.db.findFirstRow(session); if (imageData != null) { _pixelData = imageData.pixels.buffer.asUint8List(); } @@ -143,18 +143,16 @@ class PixoramaEndpoint extends Endpoint { SerializableEntity message, ) async { if (message is ImageUpdate) { - // Check that the message data is valid. If the assert fails, the message - // will be ignored and an error will be logged. Another approach to handle - // invalid data can be to close the streaming session and disconnect the - // client. - assert( - message.colorIndex >= 0 && message.colorIndex < _numColorsInPalette, - 'The received color index is not in a valid range.', - ); - assert( - message.pixelIndex >= 0 && message.pixelIndex < _pixelData.length, - 'The received pixel index is not in a valid range.', - ); + // Check that the message data is valid. If it's not valid, throw an exception + // and the message will be ignored and an error will be logged. Another + // approach to handle invalid data can be to close the streaming session and + // disconnect the client. + if (!(message.colorIndex >= 0 && message.colorIndex < _numColorsInPalette)) { + throw FormatException('The received color index is not in a valid range.'); + } + if (!(message.pixelIndex >= 0 && message.pixelIndex < _pixelData.length)) { + throw FormatException('The received pixel index is not in a valid range.'); + } // Update our global image. _setPixel(message.colorIndex, message.pixelIndex); diff --git a/pixorama_server/lib/src/generated/endpoints.dart b/pixorama_server/lib/src/generated/endpoints.dart index f84adc0..fde4eca 100644 --- a/pixorama_server/lib/src/generated/endpoints.dart +++ b/pixorama_server/lib/src/generated/endpoints.dart @@ -4,6 +4,8 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; diff --git a/pixorama_server/lib/src/generated/image_data.dart b/pixorama_server/lib/src/generated/image_data.dart index 5083f8c..2f8d051 100644 --- a/pixorama_server/lib/src/generated/image_data.dart +++ b/pixorama_server/lib/src/generated/image_data.dart @@ -4,19 +4,29 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; import 'dart:typed_data' as _i2; +import 'package:serverpod_serialization/serverpod_serialization.dart'; -class ImageData extends _i1.TableRow { - ImageData({ +abstract class ImageData extends _i1.TableRow { + ImageData._({ int? id, required this.pixels, required this.width, required this.height, }) : super(id); + factory ImageData({ + int? id, + required _i2.ByteData pixels, + required int width, + required int height, + }) = _ImageDataImpl; + factory ImageData.fromJson( Map jsonSerialization, _i1.SerializationManager serializationManager, @@ -33,6 +43,8 @@ class ImageData extends _i1.TableRow { static final t = ImageDataTable(); + static const db = ImageDataRepository._(); + _i2.ByteData pixels; int width; @@ -40,18 +52,26 @@ class ImageData extends _i1.TableRow { int height; @override - String get tableName => 'image_data'; + _i1.Table get table => t; + + ImageData copyWith({ + int? id, + _i2.ByteData? pixels, + int? width, + int? height, + }); @override Map toJson() { return { - 'id': id, - 'pixels': pixels, + if (id != null) 'id': id, + 'pixels': pixels.toJson(), 'width': width, 'height': height, }; } @override + @Deprecated('Will be removed in 2.0.0') Map toJsonForDatabase() { return { 'id': id, @@ -64,14 +84,15 @@ class ImageData extends _i1.TableRow { @override Map allToJson() { return { - 'id': id, - 'pixels': pixels, + if (id != null) 'id': id, + 'pixels': pixels.toJson(), 'width': width, 'height': height, }; } @override + @Deprecated('Will be removed in 2.0.0') void setColumn( String columnName, value, @@ -94,9 +115,10 @@ class ImageData extends _i1.TableRow { } } + @Deprecated('Will be removed in 2.0.0. Use: db.find instead.') static Future> find( _i1.Session session, { - ImageDataExpressionBuilder? where, + _i1.WhereExpressionBuilder? where, int? limit, int? offset, _i1.Column? orderBy, @@ -117,9 +139,10 @@ class ImageData extends _i1.TableRow { ); } + @Deprecated('Will be removed in 2.0.0. Use: db.findRow instead.') static Future findSingleRow( _i1.Session session, { - ImageDataExpressionBuilder? where, + _i1.WhereExpressionBuilder? where, int? offset, _i1.Column? orderBy, bool orderDescending = false, @@ -136,6 +159,7 @@ class ImageData extends _i1.TableRow { ); } + @Deprecated('Will be removed in 2.0.0. Use: db.findById instead.') static Future findById( _i1.Session session, int id, @@ -143,9 +167,10 @@ class ImageData extends _i1.TableRow { return session.db.findById(id); } + @Deprecated('Will be removed in 2.0.0. Use: db.deleteWhere instead.') static Future delete( _i1.Session session, { - required ImageDataExpressionBuilder where, + required _i1.WhereExpressionBuilder where, _i1.Transaction? transaction, }) async { return session.db.delete( @@ -154,6 +179,7 @@ class ImageData extends _i1.TableRow { ); } + @Deprecated('Will be removed in 2.0.0. Use: db.deleteRow instead.') static Future deleteRow( _i1.Session session, ImageData row, { @@ -165,6 +191,7 @@ class ImageData extends _i1.TableRow { ); } + @Deprecated('Will be removed in 2.0.0. Use: db.update instead.') static Future update( _i1.Session session, ImageData row, { @@ -176,6 +203,8 @@ class ImageData extends _i1.TableRow { ); } + @Deprecated( + 'Will be removed in 2.0.0. Use: db.insert instead. Important note: In db.insert, the object you pass in is no longer modified, instead a new copy with the added row is returned which contains the inserted id.') static Future insert( _i1.Session session, ImageData row, { @@ -187,9 +216,10 @@ class ImageData extends _i1.TableRow { ); } + @Deprecated('Will be removed in 2.0.0. Use: db.count instead.') static Future count( _i1.Session session, { - ImageDataExpressionBuilder? where, + _i1.WhereExpressionBuilder? where, int? limit, bool useCache = true, _i1.Transaction? transaction, @@ -201,20 +231,84 @@ class ImageData extends _i1.TableRow { transaction: transaction, ); } + + static ImageDataInclude include() { + return ImageDataInclude._(); + } + + static ImageDataIncludeList includeList({ + _i1.WhereExpressionBuilder? where, + int? limit, + int? offset, + _i1.OrderByBuilder? orderBy, + bool orderDescending = false, + _i1.OrderByListBuilder? orderByList, + ImageDataInclude? include, + }) { + return ImageDataIncludeList._( + where: where, + limit: limit, + offset: offset, + orderBy: orderBy?.call(ImageData.t), + orderDescending: orderDescending, + orderByList: orderByList?.call(ImageData.t), + include: include, + ); + } } -typedef ImageDataExpressionBuilder = _i1.Expression Function(ImageDataTable); +class _Undefined {} -class ImageDataTable extends _i1.Table { - ImageDataTable() : super(tableName: 'image_data'); +class _ImageDataImpl extends ImageData { + _ImageDataImpl({ + int? id, + required _i2.ByteData pixels, + required int width, + required int height, + }) : super._( + id: id, + pixels: pixels, + width: width, + height: height, + ); + + @override + ImageData copyWith({ + Object? id = _Undefined, + _i2.ByteData? pixels, + int? width, + int? height, + }) { + return ImageData( + id: id is int? ? id : this.id, + pixels: pixels ?? this.pixels.clone(), + width: width ?? this.width, + height: height ?? this.height, + ); + } +} - final id = _i1.ColumnInt('id'); +class ImageDataTable extends _i1.Table { + ImageDataTable({super.tableRelation}) : super(tableName: 'image_data') { + pixels = _i1.ColumnByteData( + 'pixels', + this, + ); + width = _i1.ColumnInt( + 'width', + this, + ); + height = _i1.ColumnInt( + 'height', + this, + ); + } - final pixels = _i1.ColumnByteData('pixels'); + late final _i1.ColumnByteData pixels; - final width = _i1.ColumnInt('width'); + late final _i1.ColumnInt width; - final height = _i1.ColumnInt('height'); + late final _i1.ColumnInt height; @override List<_i1.Column> get columns => [ @@ -227,3 +321,182 @@ class ImageDataTable extends _i1.Table { @Deprecated('Use ImageDataTable.t instead.') ImageDataTable tImageData = ImageDataTable(); + +class ImageDataInclude extends _i1.IncludeObject { + ImageDataInclude._(); + + @override + Map get includes => {}; + + @override + _i1.Table get table => ImageData.t; +} + +class ImageDataIncludeList extends _i1.IncludeList { + ImageDataIncludeList._({ + _i1.WhereExpressionBuilder? where, + super.limit, + super.offset, + super.orderBy, + super.orderDescending, + super.orderByList, + super.include, + }) { + super.where = where?.call(ImageData.t); + } + + @override + Map get includes => include?.includes ?? {}; + + @override + _i1.Table get table => ImageData.t; +} + +class ImageDataRepository { + const ImageDataRepository._(); + + 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.dbNext.find( + where: where?.call(ImageData.t), + orderBy: orderBy?.call(ImageData.t), + orderByList: orderByList?.call(ImageData.t), + orderDescending: orderDescending, + limit: limit, + offset: offset, + transaction: transaction, + ); + } + + 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.dbNext.findFirstRow( + where: where?.call(ImageData.t), + orderBy: orderBy?.call(ImageData.t), + orderByList: orderByList?.call(ImageData.t), + orderDescending: orderDescending, + offset: offset, + transaction: transaction, + ); + } + + Future findById( + _i1.Session session, + int id, { + _i1.Transaction? transaction, + }) async { + return session.dbNext.findById( + id, + transaction: transaction, + ); + } + + Future> insert( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.dbNext.insert( + rows, + transaction: transaction, + ); + } + + Future insertRow( + _i1.Session session, + ImageData row, { + _i1.Transaction? transaction, + }) async { + return session.dbNext.insertRow( + row, + transaction: transaction, + ); + } + + Future> update( + _i1.Session session, + List rows, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.dbNext.update( + rows, + columns: columns?.call(ImageData.t), + transaction: transaction, + ); + } + + Future updateRow( + _i1.Session session, + ImageData row, { + _i1.ColumnSelections? columns, + _i1.Transaction? transaction, + }) async { + return session.dbNext.updateRow( + row, + columns: columns?.call(ImageData.t), + transaction: transaction, + ); + } + + Future> delete( + _i1.Session session, + List rows, { + _i1.Transaction? transaction, + }) async { + return session.dbNext.delete( + rows, + transaction: transaction, + ); + } + + Future deleteRow( + _i1.Session session, + ImageData row, { + _i1.Transaction? transaction, + }) async { + return session.dbNext.deleteRow( + row, + transaction: transaction, + ); + } + + Future> deleteWhere( + _i1.Session session, { + required _i1.WhereExpressionBuilder where, + _i1.Transaction? transaction, + }) async { + return session.dbNext.deleteWhere( + where: where(ImageData.t), + transaction: transaction, + ); + } + + Future count( + _i1.Session session, { + _i1.WhereExpressionBuilder? where, + int? limit, + _i1.Transaction? transaction, + }) async { + return session.dbNext.count( + where: where?.call(ImageData.t), + limit: limit, + transaction: transaction, + ); + } +} diff --git a/pixorama_server/lib/src/generated/image_update.dart b/pixorama_server/lib/src/generated/image_update.dart index 0fb9381..112f429 100644 --- a/pixorama_server/lib/src/generated/image_update.dart +++ b/pixorama_server/lib/src/generated/image_update.dart @@ -4,16 +4,23 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; -class ImageUpdate extends _i1.SerializableEntity { - ImageUpdate({ +abstract class ImageUpdate extends _i1.SerializableEntity { + ImageUpdate._({ required this.pixelIndex, required this.colorIndex, }); + factory ImageUpdate({ + required int pixelIndex, + required int colorIndex, + }) = _ImageUpdateImpl; + factory ImageUpdate.fromJson( Map jsonSerialization, _i1.SerializationManager serializationManager, @@ -30,6 +37,10 @@ class ImageUpdate extends _i1.SerializableEntity { int colorIndex; + ImageUpdate copyWith({ + int? pixelIndex, + int? colorIndex, + }); @override Map toJson() { return { @@ -46,3 +57,24 @@ class ImageUpdate extends _i1.SerializableEntity { }; } } + +class _ImageUpdateImpl extends ImageUpdate { + _ImageUpdateImpl({ + required int pixelIndex, + required int colorIndex, + }) : super._( + pixelIndex: pixelIndex, + colorIndex: colorIndex, + ); + + @override + ImageUpdate copyWith({ + int? pixelIndex, + int? colorIndex, + }) { + return ImageUpdate( + pixelIndex: pixelIndex ?? this.pixelIndex, + colorIndex: colorIndex ?? this.colorIndex, + ); + } +} diff --git a/pixorama_server/lib/src/generated/protocol.dart b/pixorama_server/lib/src/generated/protocol.dart index a7b1eb0..69c7ace 100644 --- a/pixorama_server/lib/src/generated/protocol.dart +++ b/pixorama_server/lib/src/generated/protocol.dart @@ -4,15 +4,17 @@ // ignore_for_file: library_private_types_in_public_api // ignore_for_file: public_member_api_docs // ignore_for_file: implementation_imports +// ignore_for_file: use_super_parameters +// ignore_for_file: type_literal_in_constant_pattern library protocol; // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:serverpod/serverpod.dart' as _i1; -import 'image_data.dart' as _i2; -import 'image_update.dart' as _i3; -import 'package:serverpod/protocol.dart' as _i4; +import 'package:serverpod/protocol.dart' as _i2; +import 'image_data.dart' as _i3; +import 'image_update.dart' as _i4; export 'image_data.dart'; -export 'image_update.dart'; // ignore_for_file: equal_keys_in_map +export 'image_update.dart'; class Protocol extends _i1.SerializationManagerServer { Protocol._(); @@ -23,6 +25,60 @@ class Protocol extends _i1.SerializationManagerServer { static final Protocol _instance = Protocol._(); + static final List<_i2.TableDefinition> targetTableDefinitions = [ + _i2.TableDefinition( + name: 'image_data', + dartName: 'ImageData', + schema: 'public', + module: 'pixorama', + columns: [ + _i2.ColumnDefinition( + name: 'id', + columnType: _i2.ColumnType.integer, + isNullable: false, + dartType: 'int?', + columnDefault: 'nextval(\'image_data_id_seq\'::regclass)', + ), + _i2.ColumnDefinition( + name: 'pixels', + columnType: _i2.ColumnType.bytea, + isNullable: false, + dartType: 'dart:typed_data:ByteData', + ), + _i2.ColumnDefinition( + name: 'width', + columnType: _i2.ColumnType.integer, + isNullable: false, + dartType: 'int', + ), + _i2.ColumnDefinition( + name: 'height', + columnType: _i2.ColumnType.integer, + isNullable: false, + dartType: 'int', + ), + ], + foreignKeys: [], + indexes: [ + _i2.IndexDefinition( + indexName: 'image_data_pkey', + tableSpace: null, + elements: [ + _i2.IndexElementDefinition( + type: _i2.IndexElementDefinitionType.column, + definition: 'id', + ) + ], + type: 'btree', + isUnique: true, + isPrimary: true, + ) + ], + managed: true, + ), + ..._i2.Protocol.targetTableDefinitions, + ]; + @override T deserialize( dynamic data, [ @@ -32,30 +88,30 @@ class Protocol extends _i1.SerializationManagerServer { if (customConstructors.containsKey(t)) { return customConstructors[t]!(data, this) as T; } - if (t == _i2.ImageData) { - return _i2.ImageData.fromJson(data, this) as T; + if (t == _i3.ImageData) { + return _i3.ImageData.fromJson(data, this) as T; } - if (t == _i3.ImageUpdate) { - return _i3.ImageUpdate.fromJson(data, this) as T; + if (t == _i4.ImageUpdate) { + return _i4.ImageUpdate.fromJson(data, this) as T; } - if (t == _i1.getType<_i2.ImageData?>()) { - return (data != null ? _i2.ImageData.fromJson(data, this) : null) as T; + if (t == _i1.getType<_i3.ImageData?>()) { + return (data != null ? _i3.ImageData.fromJson(data, this) : null) as T; } - if (t == _i1.getType<_i3.ImageUpdate?>()) { - return (data != null ? _i3.ImageUpdate.fromJson(data, this) : null) as T; + if (t == _i1.getType<_i4.ImageUpdate?>()) { + return (data != null ? _i4.ImageUpdate.fromJson(data, this) : null) as T; } try { - return _i4.Protocol().deserialize(data, t); + return _i2.Protocol().deserialize(data, t); } catch (_) {} return super.deserialize(data, t); } @override String? getClassNameForObject(Object data) { - if (data is _i2.ImageData) { + if (data is _i3.ImageData) { return 'ImageData'; } - if (data is _i3.ImageUpdate) { + if (data is _i4.ImageUpdate) { return 'ImageUpdate'; } return super.getClassNameForObject(data); @@ -64,10 +120,10 @@ class Protocol extends _i1.SerializationManagerServer { @override dynamic deserializeByClassName(Map data) { if (data['className'] == 'ImageData') { - return deserialize<_i2.ImageData>(data['data']); + return deserialize<_i3.ImageData>(data['data']); } if (data['className'] == 'ImageUpdate') { - return deserialize<_i3.ImageUpdate>(data['data']); + return deserialize<_i4.ImageUpdate>(data['data']); } return super.deserializeByClassName(data); } @@ -75,15 +131,22 @@ class Protocol extends _i1.SerializationManagerServer { @override _i1.Table? getTableForType(Type t) { { - var table = _i4.Protocol().getTableForType(t); + var table = _i2.Protocol().getTableForType(t); if (table != null) { return table; } } switch (t) { - case _i2.ImageData: - return _i2.ImageData.t; + case _i3.ImageData: + return _i3.ImageData.t; } return null; } + + @override + List<_i2.TableDefinition> getTargetTableDefinitions() => + targetTableDefinitions; + + @override + String getModuleName() => 'pixorama'; } diff --git a/pixorama_server/generated/protocol.yaml b/pixorama_server/lib/src/generated/protocol.yaml similarity index 100% rename from pixorama_server/generated/protocol.yaml rename to pixorama_server/lib/src/generated/protocol.yaml diff --git a/pixorama_server/lib/src/protocol/image_data.yaml b/pixorama_server/lib/src/models/image_data.spy.yaml similarity index 100% rename from pixorama_server/lib/src/protocol/image_data.yaml rename to pixorama_server/lib/src/models/image_data.spy.yaml diff --git a/pixorama_server/lib/src/protocol/image_update.yaml b/pixorama_server/lib/src/models/image_update.spy.yaml similarity index 100% rename from pixorama_server/lib/src/protocol/image_update.yaml rename to pixorama_server/lib/src/models/image_update.spy.yaml diff --git a/pixorama_server/migrations/20240220083843876/definition.json b/pixorama_server/migrations/20240220083843876/definition.json new file mode 100644 index 0000000..9c8304f --- /dev/null +++ b/pixorama_server/migrations/20240220083843876/definition.json @@ -0,0 +1,1220 @@ +{ + "moduleName": "pixorama", + "tables": [ + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 2, + "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_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 2, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "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 + } + ], + "installedModules": [ + { + "module": "pixorama", + "version": "20240220083843876" + }, + { + "module": "serverpod", + "version": "20240115074235544" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/pixorama_server/migrations/20240220083843876/definition.sql b/pixorama_server/migrations/20240220083843876/definition.sql new file mode 100644 index 0000000..4af90fa --- /dev/null +++ b/pixorama_server/migrations/20240220083843876/definition.sql @@ -0,0 +1,271 @@ +BEGIN; + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" serial PRIMARY KEY, + "userId" integer 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 CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" serial 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" serial 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" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" integer NOT NULL, + "closing" integer NOT NULL, + "idle" integer NOT NULL, + "granularity" integer 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" serial 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" integer 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" serial PRIMARY KEY, + "sessionLogId" integer NOT NULL, + "messageId" integer, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" integer NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" integer 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" serial PRIMARY KEY, + "sessionLogId" integer NOT NULL, + "serverId" text NOT NULL, + "messageId" integer NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" integer NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" serial 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" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" integer NOT NULL, + "messageId" integer, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" integer, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" integer 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" serial PRIMARY KEY, + "number" integer NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" integer, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" integer, + "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"); + +-- +-- 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 pixorama +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('pixorama', '20240220083843876', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240220083843876', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240115074235544', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240115074235544', "timestamp" = now(); + + +COMMIT; diff --git a/pixorama_server/migrations/20240220083843876/definition_project.json b/pixorama_server/migrations/20240220083843876/definition_project.json new file mode 100644 index 0000000..f102aeb --- /dev/null +++ b/pixorama_server/migrations/20240220083843876/definition_project.json @@ -0,0 +1,11 @@ +{ + "moduleName": "pixorama", + "tables": [], + "installedModules": [ + { + "module": "serverpod", + "version": "20240115074235544" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/pixorama_server/migrations/20240220083843876/migration.json b/pixorama_server/migrations/20240220083843876/migration.json new file mode 100644 index 0000000..a2c8bc5 --- /dev/null +++ b/pixorama_server/migrations/20240220083843876/migration.json @@ -0,0 +1,1252 @@ +{ + "actions": [ + { + "type": "createTable", + "createTable": { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 2, + "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_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 2, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "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 + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/pixorama_server/migrations/20240220083843876/migration.sql b/pixorama_server/migrations/20240220083843876/migration.sql new file mode 100644 index 0000000..745f538 --- /dev/null +++ b/pixorama_server/migrations/20240220083843876/migration.sql @@ -0,0 +1,271 @@ +BEGIN; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_auth_key" ( + "id" serial PRIMARY KEY, + "userId" integer 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_cloud_storage" ( + "id" serial 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" serial 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" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" integer NOT NULL, + "closing" integer NOT NULL, + "idle" integer NOT NULL, + "granularity" integer 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" serial 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" integer 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" serial PRIMARY KEY, + "sessionLogId" integer NOT NULL, + "messageId" integer, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" integer NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" integer NOT NULL +); + +-- Indexes +CREATE INDEX "serverpod_log_sessionLogId_idx" ON "serverpod_log" USING btree ("sessionLogId"); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_message_log" ( + "id" serial PRIMARY KEY, + "sessionLogId" integer NOT NULL, + "serverId" text NOT NULL, + "messageId" integer NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" integer NOT NULL +); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_method" ( + "id" serial 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" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" integer NOT NULL, + "messageId" integer, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" integer, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" integer 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" serial PRIMARY KEY, + "number" integer NOT NULL +); + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" integer, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" integer, + "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 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 pixorama +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('pixorama', '20240220083843876', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240220083843876', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240115074235544', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240115074235544', "timestamp" = now(); + + +COMMIT; diff --git a/pixorama_server/migrations/20240226082417468/definition.json b/pixorama_server/migrations/20240226082417468/definition.json new file mode 100644 index 0000000..f8b6360 --- /dev/null +++ b/pixorama_server/migrations/20240226082417468/definition.json @@ -0,0 +1,1269 @@ +{ + "moduleName": "pixorama", + "tables": [ + { + "name": "image_data", + "dartName": "ImageData", + "module": "pixorama", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "isNullable": false, + "columnDefault": "nextval('image_data_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "pixels", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "width", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "height", + "columnType": 2, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "image_data_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + }, + { + "name": "serverpod_auth_key", + "dartName": "AuthKey", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_auth_key_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "userId", + "columnType": 2, + "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_cloud_storage", + "dartName": "CloudStorageEntry", + "module": "serverpod", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "closing", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "idle", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "granularity", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_message_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "messageId", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_query_log_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "serverId", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "sessionLogId", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "messageId", + "columnType": 2, + "isNullable": true, + "dartType": "int?" + }, + { + "name": "query", + "columnType": 0, + "isNullable": false, + "dartType": "String" + }, + { + "name": "duration", + "columnType": 3, + "isNullable": false, + "dartType": "double" + }, + { + "name": "numRows", + "columnType": 2, + "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": 2, + "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": 2, + "isNullable": false, + "columnDefault": "nextval('serverpod_readwrite_test_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "number", + "columnType": 2, + "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": 2, + "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": 2, + "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": 2, + "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": 2, + "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 + } + ], + "installedModules": [ + { + "module": "pixorama", + "version": "20240226082417468" + }, + { + "module": "serverpod", + "version": "20240115074235544" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/pixorama_server/migrations/20240226082417468/definition.sql b/pixorama_server/migrations/20240226082417468/definition.sql new file mode 100644 index 0000000..ab4a02b --- /dev/null +++ b/pixorama_server/migrations/20240226082417468/definition.sql @@ -0,0 +1,281 @@ +BEGIN; + +-- +-- Class ImageData as table image_data +-- +CREATE TABLE "image_data" ( + "id" serial PRIMARY KEY, + "pixels" bytea NOT NULL, + "width" integer NOT NULL, + "height" integer NOT NULL +); + +-- +-- Class AuthKey as table serverpod_auth_key +-- +CREATE TABLE "serverpod_auth_key" ( + "id" serial PRIMARY KEY, + "userId" integer 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 CloudStorageEntry as table serverpod_cloud_storage +-- +CREATE TABLE "serverpod_cloud_storage" ( + "id" serial 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" serial 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" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "timestamp" timestamp without time zone NOT NULL, + "active" integer NOT NULL, + "closing" integer NOT NULL, + "idle" integer NOT NULL, + "granularity" integer 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" serial 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" integer 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" serial PRIMARY KEY, + "sessionLogId" integer NOT NULL, + "messageId" integer, + "reference" text, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "logLevel" integer NOT NULL, + "message" text NOT NULL, + "error" text, + "stackTrace" text, + "order" integer 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" serial PRIMARY KEY, + "sessionLogId" integer NOT NULL, + "serverId" text NOT NULL, + "messageId" integer NOT NULL, + "endpoint" text NOT NULL, + "messageName" text NOT NULL, + "duration" double precision NOT NULL, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" integer NOT NULL +); + +-- +-- Class MethodInfo as table serverpod_method +-- +CREATE TABLE "serverpod_method" ( + "id" serial 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" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "sessionLogId" integer NOT NULL, + "messageId" integer, + "query" text NOT NULL, + "duration" double precision NOT NULL, + "numRows" integer, + "error" text, + "stackTrace" text, + "slow" boolean NOT NULL, + "order" integer 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" serial PRIMARY KEY, + "number" integer NOT NULL +); + +-- +-- Class RuntimeSettings as table serverpod_runtime_settings +-- +CREATE TABLE "serverpod_runtime_settings" ( + "id" serial 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" serial PRIMARY KEY, + "serverId" text NOT NULL, + "time" timestamp without time zone NOT NULL, + "module" text, + "endpoint" text, + "method" text, + "duration" double precision, + "numQueries" integer, + "slow" boolean, + "error" text, + "stackTrace" text, + "authenticatedUserId" integer, + "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"); + +-- +-- 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 pixorama +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('pixorama', '20240226082417468', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240226082417468', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240115074235544', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240115074235544', "timestamp" = now(); + + +COMMIT; diff --git a/pixorama_server/migrations/20240226082417468/definition_project.json b/pixorama_server/migrations/20240226082417468/definition_project.json new file mode 100644 index 0000000..ebb1edb --- /dev/null +++ b/pixorama_server/migrations/20240226082417468/definition_project.json @@ -0,0 +1,65 @@ +{ + "moduleName": "pixorama", + "tables": [ + { + "name": "image_data", + "dartName": "ImageData", + "module": "pixorama", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "isNullable": false, + "columnDefault": "nextval('image_data_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "pixels", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "width", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "height", + "columnType": 2, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "image_data_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + ], + "installedModules": [ + { + "module": "serverpod", + "version": "20240115074235544" + }, + { + "module": "pixorama", + "version": "20240220083843876" + } + ], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/pixorama_server/migrations/20240226082417468/migration.json b/pixorama_server/migrations/20240226082417468/migration.json new file mode 100644 index 0000000..6f48f03 --- /dev/null +++ b/pixorama_server/migrations/20240226082417468/migration.json @@ -0,0 +1,58 @@ +{ + "actions": [ + { + "type": "createTable", + "createTable": { + "name": "image_data", + "dartName": "ImageData", + "module": "pixorama", + "schema": "public", + "columns": [ + { + "name": "id", + "columnType": 2, + "isNullable": false, + "columnDefault": "nextval('image_data_id_seq'::regclass)", + "dartType": "int?" + }, + { + "name": "pixels", + "columnType": 5, + "isNullable": false, + "dartType": "dart:typed_data:ByteData" + }, + { + "name": "width", + "columnType": 2, + "isNullable": false, + "dartType": "int" + }, + { + "name": "height", + "columnType": 2, + "isNullable": false, + "dartType": "int" + } + ], + "foreignKeys": [], + "indexes": [ + { + "indexName": "image_data_pkey", + "elements": [ + { + "type": 0, + "definition": "id" + } + ], + "type": "btree", + "isUnique": true, + "isPrimary": true + } + ], + "managed": true + } + } + ], + "warnings": [], + "migrationApiVersion": 1 +} \ No newline at end of file diff --git a/pixorama_server/migrations/20240226082417468/migration.sql b/pixorama_server/migrations/20240226082417468/migration.sql new file mode 100644 index 0000000..8f95b8f --- /dev/null +++ b/pixorama_server/migrations/20240226082417468/migration.sql @@ -0,0 +1,31 @@ +BEGIN; + +-- +-- ACTION CREATE TABLE +-- +CREATE TABLE "image_data" ( + "id" serial PRIMARY KEY, + "pixels" bytea NOT NULL, + "width" integer NOT NULL, + "height" integer NOT NULL +); + + +-- +-- MIGRATION VERSION FOR pixorama +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('pixorama', '20240226082417468', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240226082417468', "timestamp" = now(); + +-- +-- MIGRATION VERSION FOR serverpod +-- +INSERT INTO "serverpod_migrations" ("module", "version", "timestamp") + VALUES ('serverpod', '20240115074235544', now()) + ON CONFLICT ("module") + DO UPDATE SET "version" = '20240115074235544', "timestamp" = now(); + + +COMMIT; diff --git a/pixorama_server/migrations/migration_registry.txt b/pixorama_server/migrations/migration_registry.txt new file mode 100644 index 0000000..32f9e90 --- /dev/null +++ b/pixorama_server/migrations/migration_registry.txt @@ -0,0 +1,8 @@ +### 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. + +20240220083843876 +20240226082417468 diff --git a/pixorama_server/pubspec.lock b/pixorama_server/pubspec.lock index 4fa75c1..61eaaa5 100644 --- a/pixorama_server/pubspec.lock +++ b/pixorama_server/pubspec.lock @@ -5,253 +5,345 @@ packages: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" buffer: dependency: transitive description: name: buffer - url: "https://pub.dartlang.org" + sha256: "94f60815065a8f0fd4f05be51faf86cf86519327e039d5c2aac72e1d1cc1dad4" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.2" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" + source: hosted + version: "1.3.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" executor: dependency: transitive description: name: executor - url: "https://pub.dartlang.org" + sha256: "87d935b31b2bdf7fe2af0b77dd8ffe8864eaade25715e9c68bc49497e48c9851" + url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.3" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba + url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "1.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.1" + version: "4.0.2" lints: dependency: "direct dev" description: name: lints - url: "https://pub.dartlang.org" + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.12.0" mustache_template: dependency: transitive description: name: mustache_template - url: "https://pub.dartlang.org" + sha256: a46e26f91445bfb0b60519be280555b06792460b27b19e2b19ad5b9740df5d1c + url: "https://pub.dev" source: hosted version: "2.0.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.0" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" + url: "https://pub.dev" source: hosted version: "1.11.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" postgres: dependency: transitive description: name: postgres - url: "https://pub.dartlang.org" + sha256: fce8406bbe8b7018c768e76816be24adf302f44c06d7176c912d2501ea6aac2a + url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.6.3" postgres_pool: dependency: transitive description: name: postgres_pool - url: "https://pub.dartlang.org" + sha256: abc8f6abcae3e82c47bfbab0631b618e038b5b5cae767454e6a193796da415f4 + url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.6+1" redis: dependency: transitive description: name: redis - url: "https://pub.dartlang.org" + sha256: "4a8218ef7b0642ff499147c7a105591208259e2f55f07db0101ace7f82f66cf9" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "4.0.0" retry: dependency: transitive description: name: retry - url: "https://pub.dartlang.org" + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" sasl_scram: dependency: transitive description: name: sasl_scram - url: "https://pub.dartlang.org" + sha256: a47207a436eb650f8fdcf54a2e2587b850dc3caef9973ce01f332b07a6fc9cb9 + url: "https://pub.dev" source: hosted version: "0.1.1" saslprep: dependency: transitive description: name: saslprep - url: "https://pub.dartlang.org" + sha256: "79c9e163a82f55da542feaf0f7a59031e74493299c92008b2b404cd88d639bb4" + url: "https://pub.dev" source: hosted version: "1.0.2" serverpod: dependency: "direct main" description: - path: "../vendor/serverpod/packages/serverpod" - relative: true - source: path - version: "0.9.20" + name: serverpod + sha256: ce56fcd13fcf5fa0d736ec05603e8aba38f65d40f9fbabfc02c18e3889785dae + url: "https://pub.dev" + source: hosted + version: "1.2.4" serverpod_client: dependency: transitive description: - path: "../vendor/serverpod/packages/serverpod_client" - relative: true - source: path - version: "0.9.20" + name: serverpod_client + sha256: "6e76c50d8aa5c7f796dd0af8307355740db01291931ab1fca5971505497e9547" + url: "https://pub.dev" + source: hosted + version: "1.2.4" serverpod_serialization: dependency: transitive description: - path: "../vendor/serverpod/packages/serverpod_serialization" - relative: true - source: path - version: "0.9.20" + name: serverpod_serialization + sha256: "295695cfcf5641bd38bd5c56dd322a9e1f6e2462bc2a539913e7e2d9ef6a6c0c" + url: "https://pub.dev" + source: hosted + version: "1.2.4" serverpod_service_client: dependency: transitive description: - path: "../vendor/serverpod/packages/serverpod_service_client" - relative: true - source: path - version: "0.9.20" + name: serverpod_service_client + sha256: c73bf40a203727346213b563473cca77cd4256594725c4f67c93b73a05f82048 + url: "https://pub.dev" + source: hosted + version: "1.2.4" serverpod_shared: dependency: transitive description: - path: "../vendor/serverpod/packages/serverpod_shared" - relative: true - source: path - version: "0.9.20" + name: serverpod_shared + sha256: "43ef6abd4c14fec5d7180b305c4b9b81c1f75bb05407ed72d65b3335bb160d4c" + url: "https://pub.dev" + source: hosted + version: "1.2.4" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" + 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 - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + super_string: + dependency: transitive + description: + name: super_string + sha256: ba41acf9fbb318b3fc0d57c9235779100394d85d83f45ab533615df1f3146ea7 + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.0.3" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.dartlang.org" + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + url: "https://pub.dev" source: hosted - version: "3.0.0+3" + version: "3.1.0+1" system_resources: dependency: transitive description: name: system_resources - url: "https://pub.dartlang.org" + sha256: "7e78cf8ef224c1e0b6bf4462322b6739fea2274fef928cbcbf21ae5e5a8272d8" + url: "https://pub.dev" source: hosted version: "1.6.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" unorm_dart: dependency: transitive description: name: unorm_dart - url: "https://pub.dartlang.org" + sha256: "5b35bff83fce4d76467641438f9e867dc9bcfdb8c1694854f230579d68cd8f4b" + url: "https://pub.dev" source: hosted version: "0.2.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 + url: "https://pub.dev" + source: hosted + version: "4.3.3" vm_service: dependency: transitive description: name: vm_service - url: "https://pub.dartlang.org" + sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246 + url: "https://pub.dev" + source: hosted + version: "14.0.0" + web: + dependency: transitive + description: + name: web + sha256: "4188706108906f002b3a293509234588823c8c979dc83304e229ff400c996b05" + url: "https://pub.dev" source: hosted - version: "9.4.0" + version: "0.4.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.dartlang.org" + sha256: "939ab60734a4f8fa95feacb55804fa278de28bdeef38e616dc08e44a84adea23" + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.3" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" sdks: - dart: ">=2.17.0 <3.0.0" + dart: ">=3.2.0 <4.0.0" diff --git a/pixorama_server/pubspec.yaml b/pixorama_server/pubspec.yaml index 504f3ce..04c40a0 100644 --- a/pixorama_server/pubspec.yaml +++ b/pixorama_server/pubspec.yaml @@ -4,11 +4,10 @@ description: Starting point for a Serverpod server. # homepage: https://www.example.com environment: - sdk: '>=2.17.0 <3.0.0' + sdk: '>=3.0.0 <4.0.0' dependencies: - serverpod: - path: ../vendor/serverpod/packages/serverpod + serverpod: 1.2.4 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/vendor/serverpod b/vendor/serverpod deleted file mode 160000 index 296a7ac..0000000 --- a/vendor/serverpod +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 296a7acd28b4193480cdc90832b01f7d30cb9637