camper/sqitch.plan

144 lines
21 KiB
Plaintext
Raw Normal View History

%syntax-version=1.0.0
%project=camper
%uri=https://dev.tandem.ws/tandem/camper
roles 2023-07-21T21:25:06Z jordi fita mas <jordi@tandem.blog> # Add database roles
schema_public [roles] 2023-07-21T21:39:58Z jordi fita mas <jordi@tandem.blog> # Set privileges to the public schema
language [roles schema_public] 2023-07-21T22:00:31Z jordi fita mas <jordi@tandem.blog> # Add relation of available languages
available_languages [schema_public language] 2023-07-21T22:03:24Z jordi fita mas <jordi@tandem.blog> # Add the initially available languages
extension_citext [schema_public] 2023-07-21T22:06:24Z jordi fita mas <jordi@tandem.blog> # Add citext extension
schema_camper [roles] 2023-07-21T22:08:39Z jordi fita mas <jordi@tandem.blog> # Add application schema
email [schema_camper extension_citext] 2023-07-21T22:11:13Z jordi fita mas <jordi@tandem.blog> # Add email domain
schema_auth [roles] 2023-07-21T22:13:23Z jordi fita mas <jordi@tandem.blog> # Add authentication schema
user [roles schema_auth email language] 2023-07-21T22:37:20Z jordi fita mas <jordi@tandem.blog> # Add user relation
extension_pgcrypto [schema_auth] 2023-07-21T22:53:25Z jordi fita mas <jordi@tandem.blog> # Add pgcrypto extension
encrypt_password [schema_auth user extension_pgcrypto] 2023-07-21T22:56:40Z jordi fita mas <jordi@tandem.blog> # Add function to encrypt users password
current_user_cookie [roles schema_camper] 2023-07-21T23:05:26Z jordi fita mas <jordi@tandem.blog> # Add function to get the cookie of the current user
current_user_email [roles schema_camper] 2023-07-21T23:09:34Z jordi fita mas <jordi@tandem.blog> # Add function to get the email of the current user
build_cookie [roles schema_camper current_user_email current_user_cookie] 2023-07-21T23:14:35Z jordi fita mas <jordi@tandem.blog> # Add function to build the cookie for the current user
login_attempt [schema_auth] 2023-07-21T23:22:17Z jordi fita mas <jordi@tandem.blog> # Add relation of log in attempts
login [roles schema_auth schema_camper extension_pgcrypto email user login_attempt build_cookie] 2023-07-21T23:29:18Z jordi fita mas <jordi@tandem.blog> # Add function to login
logout [roles schema_auth schema_camper current_user_email current_user_cookie user] 2023-07-21T23:36:12Z jordi fita mas <jordi@tandem.blog> # Add function to logout
extension_vat [schema_public] 2023-07-29T01:18:45Z jordi fita mas <jordi@tandem.blog> # Add vat extension
extension_pg_libphonenumber [schema_public] 2023-07-29T01:21:12Z jordi fita mas <jordi@tandem.blog> # Add phone numbers extension
extension_uri [schema_public] 2023-07-29T01:23:46Z jordi fita mas <jordi@tandem.blog> # Add URI extension
currency_code [schema_camper] 2023-07-29T01:27:28Z jordi fita mas <jordi@tandem.blog> # Add domain for currency core in ISO 4217
currency [roles schema_camper currency_code] 2023-07-29T01:32:53Z jordi fita mas <jordi@tandem.blog> # Add relation for currencies
available_currencies [schema_camper currency] 2023-07-29T01:36:57Z jordi fita mas <jordi@tandem.blog> # Add the initial list of available currencies
country_code [schema_camper] 2023-07-29T01:39:07Z jordi fita mas <jordi@tandem.blog> # Add domain for country code
country [roles schema_camper country_code] 2023-07-29T01:42:45Z jordi fita mas <jordi@tandem.blog> # Add relation for country
country_i18n [roles schema_camper country_code language country] 2023-07-29T01:45:48Z jordi fita mas <jordi@tandem.blog> # Add relation of country internationalization
available_countries [schema_camper country country_i18n] 2023-07-29T01:48:40Z jordi fita mas <jordi@tandem.blog> # Add the list of available countries
company [roles schema_camper extension_vat email extension_pg_libphonenumber extension_uri currency_code currency country_code country language] 2023-07-29T01:56:41Z jordi fita mas <jordi@tandem.blog> # Add relation for company
company_user [roles schema_camper user company] 2023-07-29T02:08:07Z jordi fita mas <jordi@tandem.blog> # Add relation of company user
ensure_role_exists [roles schema_camper company_user] 2023-07-21T22:48:56Z jordi fita mas <jordi@tandem.blog> # Add trigger to ensure users role exists
company_host [roles schema_public] 2023-08-03T17:46:45Z jordi fita mas <jordi@tandem.blog> # Add relation of DNS domain and company
check_cookie [roles schema_public schema_auth user company_host company_user] 2023-07-21T23:40:55Z jordi fita mas <jordi@tandem.blog> # Add function to check if a user cookie is valid
set_cookie [roles schema_public check_cookie] 2023-07-21T23:44:30Z jordi fita mas <jordi@tandem.blog> # Add function to set the role base don the cookie
current_company_id [roles schema_camper] 2023-08-07T10:44:36Z jordi fita mas <jordi@tandem.blog> # Add function to get the ID of the current company
user_profile [roles schema_camper user company_user current_user_email current_user_cookie current_company_id] 2023-07-21T23:47:36Z jordi fita mas <jordi@tandem.blog> # Add view for user profile
policies_company [company user_profile] 2023-08-07T20:04:26Z jordi fita mas <jordi@tandem.blog> # Add row-level security profiles to company
change_password [roles schema_auth schema_camper user] 2023-07-21T23:54:52Z jordi fita mas <jordi@tandem.blog> # Add function to change the current users password
Add cover media to campsite types This is the image that is shown at the home page, and maybe other pages in the future. We can not use a static file because this image can be changed by the customer, not us; just like name and description. I decided to keep the actual media content in the database, but to copy this file out to the file system the first time it is accessed. This is because we are going to replicate the database to a public instance that must show exactly the same image, but the customer will update the image from the private instance, behind a firewall. We could also synchronize the folder where they upload the images, the same way we will replicate, but i thought that i would make the whole thing a little more brittle: this way if it can replicate the update of the media, it is impossible to not have its contents; dumping it to a file is to improve subsequent requests to the same media. I use the hex representation of the media’s hash as the URL to the resource, because PostgreSQL’s base64 is not URL save (i.e., it uses RFC2045’s charset that includes the forward slash[0]), and i did not feel necessary write a new function just to slightly reduce the URLs’ length. Before checking if the file exists, i make sure that the given hash is an hex string, like i do for UUID, otherwise any other check is going to fail for sure. I moved out hex.Valid function from UUID to check for valid hex values, but the actual hash check is inside app/media because i doubt it will be used outside that module. [0]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.8
2023-09-10 01:04:18 +00:00
media_type [schema_camper] 2023-09-08T17:17:02Z jordi fita mas <jordi@tandem.blog> # Add domain for media type
media_content [roles schema_camper media_type] 2023-09-19T23:21:22Z jordi fita mas <jordi@tandem.blog> # Add relation for media content bytes
media [roles schema_camper company media_content user_profile] 2023-09-08T16:50:55Z jordi fita mas <jordi@tandem.blog> # Add relation of uploaded media
add_media [roles schema_camper media media_content media_type] 2023-09-08T17:40:28Z jordi fita mas <jordi@tandem.blog> # Add function to create media
edit_media [roles schema_camper media_content media media_type] 2023-09-20T15:46:53Z jordi fita mas <jordi@tandem.blog> # Add function to edit a media
Make home page’s carousel manageable via the database I debated with myself whether to create the home_carousel relation or rather if it would be better to have a single carousel relation for all pages. However, i thought that it would be actually harder to maintain a single relation because i would need an additional column to tell one carrousel from another, and what would that column be? An enum? A foreign key to another relation? home_carousel carries no such issues. I was starting to duplicate logic all over the packages, such as the way to encode media paths or “localization” (l10n) input fields. Therefore, i refactorized them. In the case of media path, i added a function that accepts rows of media, because always need the same columns from the row, and it was yet another repetition if i needed to pass them all the time. Plus, these kind of functions can be called as `table.function`, that make them look like columns from the table; if PostgreSQL implemented virtual generated columns, i would have used that instead. I am not sure whether that media_path function can be immutable. An immutable function is “guaranteed to return the same results given the same arguments forever”, which would be true if the inputs where the hash and the original_filename columns, instead of the whole rows, but i left it as static because i did not know whether PostgreSQL interprets the “same row but with different values” as a different input. That is, whether PostgreSQL’s concept of row is the actual tuple or the space that has a rowid, irrespective of contents; in the latter case, the function can not be immutable. Just to be in the safe side, i left it stable. The home page was starting to grow a bit too much inside the app package, new that it has its own admin handler, and moved it all to a separate package.
2023-09-14 23:05:38 +00:00
media_path [roles schema_camper media] 2023-09-13T22:50:14Z jordi fita mas <jordi@tandem.blog> # Add function to get the URL path of a media
Add cover media to campsite types This is the image that is shown at the home page, and maybe other pages in the future. We can not use a static file because this image can be changed by the customer, not us; just like name and description. I decided to keep the actual media content in the database, but to copy this file out to the file system the first time it is accessed. This is because we are going to replicate the database to a public instance that must show exactly the same image, but the customer will update the image from the private instance, behind a firewall. We could also synchronize the folder where they upload the images, the same way we will replicate, but i thought that i would make the whole thing a little more brittle: this way if it can replicate the update of the media, it is impossible to not have its contents; dumping it to a file is to improve subsequent requests to the same media. I use the hex representation of the media’s hash as the URL to the resource, because PostgreSQL’s base64 is not URL save (i.e., it uses RFC2045’s charset that includes the forward slash[0]), and i did not feel necessary write a new function just to slightly reduce the URLs’ length. Before checking if the file exists, i make sure that the given hash is an hex string, like i do for UUID, otherwise any other check is going to fail for sure. I moved out hex.Valid function from UUID to check for valid hex values, but the actual hash check is inside app/media because i doubt it will be used outside that module. [0]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.8
2023-09-10 01:04:18 +00:00
campsite_type [roles schema_camper company media user_profile] 2023-07-31T11:20:29Z jordi fita mas <jordi@tandem.blog> # Add relation of campsite type
campsite_type_i18n [roles schema_camper campsite_type language] 2023-09-12T10:31:29Z jordi fita mas <jordi@tandem.blog> # Add relation for campsite_type translations
translate_campsite_type [roles schema_camper campsite_type_i18n] 2023-09-14T23:08:50Z jordi fita mas <jordi@tandem.blog> # Add function to translate a campsite type
add_campsite_type [roles schema_camper campsite_type company] 2023-08-04T16:14:48Z jordi fita mas <jordi@tandem.blog> # Add function to create campsite types
edit_campsite_type [roles schema_camper campsite_type company] 2023-08-07T22:21:34Z jordi fita mas <jordi@tandem.blog> # Add function to edit campsite types
campsite [roles schema_camper company campsite_type user_profile] 2023-08-14T10:11:51Z jordi fita mas <jordi@tandem.blog> # Add campsite relation
add_campsite [roles schema_camper campsite campsite_type] 2023-08-14T17:03:23Z jordi fita mas <jordi@tandem.blog> # Add function to create campsites
edit_campsite [roles schema_camper campsite] 2023-08-14T17:28:16Z jordi fita mas <jordi@tandem.blog> # Add function to update campsites
input_is_valid [roles schema_public] 2023-08-15T20:10:59Z jordi fita mas <jordi@tandem.blog> # Add function to check if an input string is valid for a domain
input_is_valid_phone [roles schema_public extension_pg_libphonenumber] 2023-08-15T20:15:01Z jordi fita mas <jordi@tandem.blog> # Add function to check if an input string is valid for the phone number domain
color [schema_camper extension_citext] 2023-08-16T12:46:43Z jordi fita mas <jordi@tandem.blog> # Add domain for HTML colors
to_integer [roles schema_camper color] 2023-08-16T13:02:08Z jordi fita mas <jordi@tandem.blog> # Add function to convert color to integer
to_color [roles schema_camper color] 2023-08-16T13:11:32Z jordi fita mas <jordi@tandem.blog> # Add function to convert integer to color
season [roles schema_camper company user_profile] 2023-08-16T13:21:28Z jordi fita mas <jordi@tandem.blog> # Add relation of (tourist) season
add_season [roles schema_camper season color to_integer] 2023-08-16T16:59:17Z jordi fita mas <jordi@tandem.blog> # Add function to create seasons
edit_season [roles schema_camper season color to_integer] 2023-08-16T17:09:02Z jordi fita mas <jordi@tandem.blog> # Add function to update seasons
home_carousel [roles schema_camper company media user_profile] 2023-09-13T17:16:34Z jordi fita mas <jordi@tandem.blog> # Add relation for home pages image carousel
Make home page’s carousel manageable via the database I debated with myself whether to create the home_carousel relation or rather if it would be better to have a single carousel relation for all pages. However, i thought that it would be actually harder to maintain a single relation because i would need an additional column to tell one carrousel from another, and what would that column be? An enum? A foreign key to another relation? home_carousel carries no such issues. I was starting to duplicate logic all over the packages, such as the way to encode media paths or “localization” (l10n) input fields. Therefore, i refactorized them. In the case of media path, i added a function that accepts rows of media, because always need the same columns from the row, and it was yet another repetition if i needed to pass them all the time. Plus, these kind of functions can be called as `table.function`, that make them look like columns from the table; if PostgreSQL implemented virtual generated columns, i would have used that instead. I am not sure whether that media_path function can be immutable. An immutable function is “guaranteed to return the same results given the same arguments forever”, which would be true if the inputs where the hash and the original_filename columns, instead of the whole rows, but i left it as static because i did not know whether PostgreSQL interprets the “same row but with different values” as a different input. That is, whether PostgreSQL’s concept of row is the actual tuple or the space that has a rowid, irrespective of contents; in the latter case, the function can not be immutable. Just to be in the safe side, i left it stable. The home page was starting to grow a bit too much inside the app package, new that it has its own admin handler, and moved it all to a separate package.
2023-09-14 23:05:38 +00:00
home_carousel_i18n [roles schema_camper home_carousel language] 2023-09-13T23:22:42Z jordi fita mas <jordi@tandem.blog> # Add relation for home carousel translations
add_home_carousel_slide [roles schema_camper home_carousel] 2023-09-14T17:49:21Z jordi fita mas <jordi@tandem.blog> # Add function to create slides for the home carousel
translate_home_carousel_slide [roles schema_camper home_carousel_i18n] 2023-09-14T18:17:36Z jordi fita mas <jordi@tandem.blog> # Add function to translate a home carousel slider
remove_home_carousel_slide [roles schema_camper home_carousel home_carousel_i18n] 2023-09-14T21:57:48Z jordi fita mas <jordi@tandem.blog> # Add function to remove sliders from the home carousel
services_carousel [roles schema_camper company media user_profile] 2023-09-16T22:37:47Z jordi fita mas <jordi@tandem.blog> # Add relation for services image carousel
services_carousel_i18n [roles schema_camper services_carousel language] 2023-09-16T22:42:14Z jordi fita mas <jordi@tandem.blog> # Add relation for services carousel translations
add_services_carousel_slide [roles schema_camper services_carousel] 2023-09-16T22:45:49Z jordi fita mas <jordi@tandem.blog> # Add function to create slides for the services carousel
translate_services_carousel_slide [roles schema_camper services_carousel_i18n] 2023-09-16T22:46:43Z jordi fita mas <jordi@tandem.blog> # Add function to translate a services carousel slide
remove_services_carousel_slide [roles schema_camper services_carousel services_carousel_i18n] 2023-09-16T22:47:54Z jordi fita mas <jordi@tandem.blog> # Add function to remove slides from the services carousel
icon [roles schema_camper] 2023-09-16T23:11:48Z jordi fita mas <jordi@tandem.blog> # Add relation for icon
available_icons [schema_camper icon] 2023-09-16T23:15:03Z jordi fita mas <jordi@tandem.blog> # Add the list of available icons
service [roles schema_camper company icon user_profile] 2023-09-16T23:48:19Z jordi fita mas <jordi@tandem.blog> # Add relation of services definition
add_service [roles schema_camper service] 2023-09-17T00:00:00Z jordi fita mas <jordi@tandem.blog> # Add function to create services
edit_service [roles schema_camper service] 2023-09-17T00:01:16Z jordi fita mas <jordi@tandem.blog> # Add function to edit services
service_i18n [roles schema_camper service language] 2023-09-17T00:13:42Z jordi fita mas <jordi@tandem.blog> # Add relation for service translations
translate_service [roles schema_camper service_i18n] 2023-09-17T00:17:00Z jordi fita mas <jordi@tandem.blog> # Add function to translate a service
remove_service [roles schema_camper service service_i18n] 2023-09-26T15:21:00Z jordi fita mas <jordi@tandem.blog> # Add function to remove service
translation [schema_camper] 2023-09-25T16:27:50Z jordi fita mas <jordi@tandem.blog> # Add the type for a translation
extension_btree_gist [schema_public] 2023-09-26T17:49:30Z jordi fita mas <jordi@tandem.blog> # Add btree_gist extension
season_calendar [roles schema_camper season extension_btree_gist user_profile] 2023-09-26T18:07:21Z jordi fita mas <jordi@tandem.blog> # Add the relation of date ranges for seasons
unset_season_range [roles schema_camper season_calendar] 2023-09-26T21:56:38Z jordi fita mas <jordi@tandem.blog> # Add function to unset a date range from the seasons calendar
set_season_range [roles schema_camper season_calendar unset_season_range] 2023-09-26T18:37:29Z jordi fita mas <jordi@tandem.blog> # Add function to set a seasons date range
2023-10-01 19:14:39 +00:00
campsite_type_cost [roles schema_camper campsite_type season user_profile] 2023-10-01T15:45:37Z jordi fita mas <jordi@tandem.blog> # Add relation of costs for campsite types
parse_price [roles schema_camper] 2023-10-01T16:27:50Z jordi fita mas <jordi@tandem.blog> # Add function to format cents to prices
to_price [roles schema_camper] 2023-10-01T16:30:40Z jordi fita mas <jordi@tandem.blog> # Add function to format cents to prices
set_campsite_type_cost [roles schema_camper campsite_type_cost parse_price] 2023-10-01T17:51:23Z jordi fita mas <jordi@tandem.blog> # Add function to set the cost of a campsite type for a given season
season_i18n [roles schema_camper season language] 2023-10-03T18:30:42Z jordi fita mas <jordi@tandem.blog> # Add relation for season translations
translate_season [roles schema_camper season season_i18n] 2023-10-03T18:37:19Z jordi fita mas <jordi@tandem.blog> # Add function to translate seasons
campsite_type_option [roles schema_camper campsite_type user_profile] 2023-10-05T16:19:03Z jordi fita mas <jordi@tandem.blog> # Add relation for campsite type “extra” options
campsite_type_option_i18n [roles schema_camper campsite_type_option language] 2023-10-05T16:56:57Z jordi fita mas <jordi@tandem.blog> # Add the relation for campsite_type_option internationalization
translate_campsite_type_option [roles schema_camper campsite_type_option_i18n] 2023-10-05T17:05:31Z jordi fita mas <jordi@tandem.blog> # Add function to translate campsite type options
campsite_type_option_cost [roles schema_camper campsite_type season campsite_type_option user_profile] 2023-10-05T17:21:30Z jordi fita mas <jordi@tandem.blog> # Add relation for campsite type option cost
set_campsite_type_option_cost [roles schema_camper campsite_type_option_cost parse_price] 2023-10-05T17:41:58Z jordi fita mas <jordi@tandem.blog> # Add function to set cost of campsite type option
add_campsite_type_option [roles schema_camper campsite_type_option campsite_type] 2023-10-06T09:40:03Z jordi fita mas <jordi@tandem.blog> # Add function to create new campsite type options
edit_campsite_type_option [roles schema_camper campsite_type_option] 2023-10-06T09:51:02Z jordi fita mas <jordi@tandem.blog> # Add function to edit campsite type options
campsite_type_carousel [roles schema_camper campsite_type media user_profile] 2023-10-09T17:18:38Z jordi fita mas <jordi@tandem.blog> # Add the carousel for campsite types
campsite_type_carousel_i18n [roles schema_camper campsite_type_carousel language] 2023-10-09T17:45:09Z jordi fita mas <jordi@tandem.blog> # Add relation for campsite type carousel translations
add_campsite_type_carousel_slide [roles schema_camper campsite_type_carousel campsite_type] 2023-10-09T17:59:49Z jordi fita mas <jordi@tandem.blog> # Add function to create slides for the campsite type carousel
translate_campsite_type_carousel_slide [roles schema_camper campsite_type campsite_type_carousel_i18n] 2023-10-09T18:17:13Z jordi fita mas <jordi@tandem.blog> # Add function to translate a campsite type slide
remove_campsite_type_carousel_slide [roles schema_camper campsite_type_carousel campsite_type_carousel_i18n] 2023-10-09T18:26:49Z jordi fita mas <jordi@tandem.blog> # Add function to remove campsite type slides
campsite_type_feature [roles schema_camper campsite_type icon user_profile] 2023-10-13T16:14:27Z jordi fita mas <jordi@tandem.blog> # Add the relation of campsite type feature
campsite_type_feature_i18n [roles schema_camper campsite_type_feature language] 2023-10-13T16:29:07Z jordi fita mas <jordi@tandem.blog> # Add relation for campsite_type_feature internationalization
add_campsite_type_feature [roles schema_camper campsite_type_feature campsite_type] 2023-10-13T16:26:04Z jordi fita mas <jordi@tandem.blog> # Add function to create new campsite type features
edit_campsite_type_feature [roles schema_camper campsite_type_feature] 2023-10-13T16:37:43Z jordi fita mas <jordi@tandem.blog> # Add function to update campsite type features
translate_campsite_type_feature [roles schema_camper campsite_type_feature_i18n] 2023-10-13T16:43:55Z jordi fita mas <jordi@tandem.blog> # Add function to translate campsite type features
Implement Redsys request signature in PostgreSQL Every company need to have its own merchant code and encryption key, thus it is not possible to use environment variables to keep that data, and i have to store it in the database. I do not want to give SELECT permission on the encryption key to guest, because i am going to fuck it up sooner or later, and everyone would be able to read that secret; i know it would. Therefore, i need a security definer function that takes the data to encrypt, use the key to encrypt it, and returns the result; nobody else should have access to that key, not even admins! By the way, i found out that every merchant receives the same key, thus it is not a problem to keep it in the repository. Since i need that SQL function to encrypt the data, i thought that i may go the whole nine yards and sign the request in PostgreSQL too, after all the data to sign comes from there, and it has JSON functions to create and base64-code an object. Fortunately, pg_crypto has all the functions that i need, but i can no longer keep that extension inside the auth schema, because it is used from others, and the public schema, like every other extensions, seems more appropriate. Instead of having the list of currency and language codes that Redsys uses as constants in the code, i moved that as field to the currency and language relations, so i can simply pass the lang_tag to the function and it can transform that tag to the correct code; the currency is from the company’s relation, since it is the only currency used in the whole application (for now). As a consequence, i had to grant execute to currency and the parse_price functions to guest, too. To generate the test data used in the unit tests, i used a third-party PHP implementation[0], but i only got from that the resulting base64-coded JSON object and signature, using the same that as in the unit test, and did not use any code from there. PostgreSQL formats the JSON as text differently than most implementations i have seen: it adds spaces between the key name and the colons, and space between the value and the separating comma. The first implementation used replace() to format the JSON as exactly as the PHP implementation, so that the result matches, and then tried to do generate the form by hand using the output from PostgreSQL without the replace(), to verify that Redsys would still accept my input. Finally, i adjusted the unit test to whatever pg_prove said it was getting from the function. I still have the form’s action hard-codded to the test environment, but the idea is that administrators should be able to switch from test to live themselves. That means that i need that info in the redsys relation as well. I think this is one of the few use cases for SQL’s types, because it is unlikely to change anytime soon, and i do not need the actual labels. Unfortunately, i could not use enumerations for the request’s transaction type because i can not attach an arbitrary number to the enum’s values. Having a relation is overkill, because i would need a constant in Go to refer to its primary key anyway, thus i kept the same constant i had before for that. Language and currency constant went out, as this is in the corresponding relations. In setup_redsys i must have a separate update if the encrypt_key is null because PostgreSQL checks constraints before key conflict, and i do not want to give a default value to the key if the row is not there yet. The problem is that i want to use null to mean “keep the same password”, because it is what i intend to do with the user-facing form: leave the input empty to keep the same password. As now Go needs to pass composite types back and forth with PostgreSQL, i need to register these types, and i have to do it every time because the only moment i have access to the non-pooled connection is in the AfterConnect function, but at that point i have no idea whether the user is going to request a payment. I do not know how much the performance degrades because of this. [0]: https://github.com/ssheduardo/sermepa/blob/master/src/Sermepa/Tpv/Tpv.php
2023-10-26 23:52:04 +00:00
redsys_environment [schema_camper] 2023-10-26T17:55:13Z jordi fita mas <jordi@tandem.blog> # Add enumeration of Redsys environments
redsys_integration [schema_camper] 2023-10-26T18:10:21Z jordi fita mas <jordi@tandem.blog> # Add enumeration for Redsys integrations
redsys [roles schema_camper company redsys_environment redsys_integration user_profile] 2023-10-26T16:26:23Z jordi fita mas <jordi@tandem.blog> # Add the relation for Redsys settings
setup_redsys [roles schema_camper redsys redsys_environment redsys_integration] 2023-10-26T17:20:29Z jordi fita mas <jordi@tandem.blog> # Add function to setup Redsys parameters
redsys_request [schema_camper extension_uri] 2023-10-26T18:50:55Z jordi fita mas <jordi@tandem.blog> # Add the composite type of a Redsys request
redsys_signed_request [schema_camper] 2023-10-26T18:54:48Z jordi fita mas <jordi@tandem.blog> # Add the composite type of a Redsys signed request
zero_pad [roles schema_camper] 2023-10-26T19:57:00Z jordi fita mas <jordi@tandem.blog> # Add function to pad a bytea with zeros in front
redsys_encrypt [roles schema_camper zero_pad redsys extension_pgcrypto] 2023-10-26T20:18:00Z jordi fita mas <jordi@tandem.blog> # Add function to encrypt data with Redsys encrypt key
encode_base64url [roles schema_camper] 2023-10-26T21:00:47Z jordi fita mas <jordi@tandem.blog> # Add function to encode bytea the so-called base64url
redsys_sign_request [roles extension_pgcrypto schema_camper encode_base64url redsys_encrypt redsys_request redsys_signed_request company currency language] 2023-10-26T21:12:01Z jordi fita mas <jordi@tandem.blog> # Add the function that signs Redsys requests
order_campsite_types [schema_camper roles campsite_type] 2023-12-20T15:56:34Z jordi fita mas <jordi@tandem.blog> # Add function to order campsite types
order_seasons [schema_camper roles season] 2023-12-20T16:56:54Z jordi fita mas <jordi@tandem.blog> # Add function to order seasons
order_campsite_type_options [schema_camper roles campsite_type_option] 2023-12-20T17:25:09Z jordi fita mas <jordi@tandem.blog> # Add function to order campsite type options
order_campsite_type_carousel [schema_camper roles campsite_type campsite_type_carousel] 2023-12-20T17:59:54Z jordi fita mas <jordi@tandem.blog> # Add function to order campsite type carousel
order_home_carousel [schema_camper roles home_carousel] 2023-12-20T18:30:12Z jordi fita mas <jordi@tandem.blog> # Add function to order home carousel
order_services_carousel [schema_camper roles services_carousel] 2023-12-20T18:39:18Z jordi fita mas <jordi@tandem.blog> # Add function to order services carousel
2023-12-21 16:33:01 +00:00
order_campsite_type_features [schema_camper roles campsite_type_feature] 2023-12-21T16:13:14Z jordi fita mas <jordi@tandem.blog> # Add function to order campsite type features
2023-12-21 23:26:23 +00:00
location [schema_camper roles company user_profile] 2023-12-21T17:01:28Z jordi fita mas <jordi@tandem.blog> # Add table to keep location information
location_i18n [roles schema_camper location language] 2023-12-21T17:32:50Z jordi fita mas <jordi@tandem.blog> # Add relation for location internationalization
translate_location [roles schema_camper location_i18n] 2023-12-21T17:37:47Z jordi fita mas <jordi@tandem.blog> # Add function to translate location
setup_location [roles schema_camper location] 2023-12-21T19:26:53Z jordi fita mas <jordi@tandem.blog> # Add function to setup location settings
2023-12-22 01:23:18 +00:00
legal_text [roles schema_camper company user_profile] 2023-12-21T23:29:28Z jordi fita mas <jordi@tandem.blog> # Add relation for legal documents
legal_text_i18n [roles schema_camper legal_text language] 2023-12-21T23:51:09Z jordi fita mas <jordi@tandem.blog> # Add relation for legal text internationalization
translate_legal_text [roles schema_camper legal_text_i18n] 2023-12-22T00:10:05Z jordi fita mas <jordi@tandem.blog> # Add function to translate legal texts
2024-01-12 18:16:56 +00:00
@v0 2024-01-12T18:16:37Z jordi fita mas <jordi@tandem.blog> # Version 0
add_services_carousel_slide [add_services_carousel_slide@v0] 2024-01-12T18:17:33Z jordi fita mas <jordi@tandem.blog> # Change add_services_carousel_slides return type from void to integer
service__position [service] 2024-01-12T23:47:29Z jordi fita mas <jordi@tandem.blog> # Add position column to service
order_services [schema_camper roles service service__position] 2024-01-12T23:52:24Z jordi fita mas <jordi@tandem.blog> # Add function to order services
company__tourist_tax [company] 2024-01-14T00:06:26Z jordi fita mas <jordi@tandem.blog> # Add tourist_tax to company
campsite_type__additional_info [campsite_type] 2024-01-14T21:59:50Z jordi fita mas <jordi@tandem.blog> # Add additional_info column to campsite_type
campsite_type_i18n__additional_info [campsite_type_i18n] 2024-01-14T22:03:03Z jordi fita mas <jordi@tandem.blog> # Add additional_info column to campsite_type_i18n
add_campsite_type [add_campsite_type@v0 campsite_type__additional_info] 2024-01-14T22:06:19Z jordi fita mas <jordi@tandem.blog> # Add additional_info parameter to add_campsite_type
edit_campsite_type [edit_campsite_type@v0 campsite_type__additional_info] 2024-01-14T22:09:40Z jordi fita mas <jordi@tandem.blog> # Add additional_info parameter to edit_campsite_type
translate_campsite_type [translate_campsite_type@v0 campsite_type_i18n__additional_info] 2024-01-14T22:12:08Z jordi fita mas <jordi@tandem.blog> # Add additional_info parameter to translate_campsite_type