Flyway "ORA-00955: name is already used by an existing object" - flyway

We are trying to use Flyway to manage our database schema updates with the following spring-boot configuration:
spring:
datasource:
driver-class-name: oracle.jdbc.OracleDriver
password: ${java_user_password}
url: ${DB_URL}
username: JAVA_USER
flyway:
locations: classpath:/db/migration
user: SUPER_USER
password: ${password_of_super_user}
baseline-on-migrate: true
url: ${DB_URL}
schema: JAVA_USER
Flyway version 5.1.4.
The configuration is working in Oracle 12.1.0.2.0 Standard Edition but not in Enterprise edition. We keep getting the following error:
SQL State : 42000
Error Code : 955
Message : ORA-00955: name is already used by an existing object
Line : 17
Statement : CREATE TABLE "JAVA_USER"."flyway_schema_history" (
"installed_rank" INT NOT NULL,
"version" VARCHAR2(50),
"description" VARCHAR2(200) NOT NULL,
"type" VARCHAR2(20) NOT NULL,
"script" VARCHAR2(1000) NOT NULL,
"checksum" INT,
"installed_by" VARCHAR2(100) NOT NULL,
"installed_on" TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
"execution_time" INT NOT NULL,
"success" NUMBER(1) NOT NULL
)
Any idea why? Before starting the spring-boot application we delete all objects under the schemas.
Thanks!

Related

Flutter: GraphQLError: invalid input syntax for type uuid: ""

I am new to GraphQL and Hasura. I am acquiring a firebase user JWT and passing it to a Hasura GraphQL endpoint, but I'm receiving error messages
GTMSessionFetcher invoking fetch callbacks, data {length = 3322, bytes = 0x7b0a2020 22616363 6573735f 746f6b65 ... 31303535 220a7d0a }, error (null)
flutter: OperationException(linkException: null, graphqlErrors: [GraphQLError(message: invalid input syntax for type uuid: "", locations: null, path: null, extensions: {path: $.selectionSet.insert_member_one.args.object, code: data-exception})])
You are getting this error because the URL passed in the initialization of graphql client is wrong or has special characters included. Try using
Uri.Parse('YOUR_URL_HERE)
in the GraphQLClient()
An empty string is 1: not null, if it's a nullable field, and 2: not a valid uuid (v4 at least, I ran into this same problem) use 00000000-0000-0000-0000-000000000000 as nil/empty uuid v4.
https://www.uuidgenerator.net/version-nil

Error while editing existing GSI on my scheme

I am using AppSync with DynamoDB and GraphQL API. My current scheme works as expected but when trying to edit existing GSI I am getting an error.
My current scheme looks like this:
type Item #model
#key(fields: ["id", "version"])
#key(name: "type-subtype", fields: ["type", "subtype"])
{
id: ID!
version: String!
type: String!
subtype: String!
}
I want to change GSI defined here to be:
#key(name: "version-type-subtype", fields: ["version", "type", "subtype"]
The error I am getting is Schema Creation Status is FAILED with details: Failed to parse schema document - ensure it's a valid SDL-formatted document.
Can someone help? Is there any constraint using sort key from primary index as hash in GSI that I am not aware of?
Thanks

OrientDB 3.0.4 Console EMBEDDEDLIST CREATE VERTEX

It appears that console application in OrientDB 3.0.4 is not backward compatible with OrientDB 3.0.2 for creating Vertex having EMBEDDEDLIST.
Following Query fails in OrientDB 3.0.4 console:
CREATE VERTEX Profile SET name = "John", phone = [{ "#type":"d", "number" : "212" }]
How can I resolve the issue?
What are the changes for v3.0.4 and where can I find updated documentation?
OrientDB console v.3.0.2 - Veloce (build e47e693f1470a7a642461be26983d4eca70777fd, branch develop)
OrientDB console v.3.0.2 - Veloce (build e47e693f1470a7a642461be26983d4eca70777fd, branch develop) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> create database remote:localhost/mydb root orientdb
Creating database [remote:localhost/mydb] using the storage type [PLOCAL]...
Database created successfully.
Current database is: remote:localhost/mydb
orientdb {db=mydb}> create class Phone EXTENDS V
Class created successfully.
orientdb {db=mydb}> create property Phone.number String
Property created successfully.
orientdb {db=mydb}> create class Profile EXTENDS V
Class created successfully.
orientdb {db=mydb}> create property Profile.name String
Property created successfully.
orientdb {db=mydb}> create property Profile.phone embeddedList Phone
Property created successfully.
orientdb {db=mydb}> CREATE VERTEX Profile SET name = "John", phone = [{ "#type":"d", "number" : "212" }]
Created vertex '[Profile#33:0{name:John,phone:[1]} v1]' in 0.023000 sec(s).
-------
OrientDB console v.3.0.4 - Veloce (build 4578b51f72a55feaa0852bc8ddd52929011d956c, branch 3.0.x)
OrientDB console v.3.0.4 - Veloce (build 4578b51f72a55feaa0852bc8ddd52929011d956c, branch 3.0.x) https://www.orientdb.com
Type 'help' to display all the supported commands.
orientdb> create database remote:localhost/mydb root orientdb
Creating database [remote:localhost/mydb] using the storage type [PLOCAL]...
Database created successfully.
Current database is: remote:localhost/mydb
orientdb {db=mydb}> create class Phone EXTENDS V
Class created successfully.
orientdb {db=mydb}> create property Phone.number String
Property created successfully.
orientdb {db=mydb}> create class Profile EXTENDS V
Class created successfully.
orientdb {db=mydb}> create property Profile.name String
Property created successfully.
orientdb {db=mydb}> create property Profile.phone embeddedList Phone
Property created successfully.
orientdb {db=mydb}> CREATE VERTEX Profile SET name = "John", phone = [{ "#type":"d", "number" : "212" }]
Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
create VERTEX Profile SET name = "John", phone = [{ "#type":"d", "number" : "212" }
^
Encountered " "[" "[ "" at line 1, column 50.
Was expecting one of:
...
...
...
"{" ...
...
...
...
"{" ...
"{" ...
...
...
...
"{" ...
"{" ...
"{" ...
...
...
...
"{" ...
"{" ...
...
...
...
"{" ...
"{" ...
...
...
...
"{" ...
"{" ...
"{" ...
DB name="mydb"
Error Code="1"
DB name="mydb"
!Unrecognized command: ']'
orientdb {db=mydb}>
The issue is that you've declared your property as "Phone" and then you're trying to create your vertex using the name "phone" in lowercase which doesn't match the schema.
Also there's no need to use square brackets so instead of that last query, try using:
CREATE VERTEX Profile SET name = "John", Phone = { "#type":"d", "number" : "212"}

Gedmo Translatable yaml mapping

Is it possible to map Gedmo with yaml ? I'm using yaml file in my project and I would like to use Translatable from doctrine extensions but I have a problem with it.
I have something like that (one entity / one translation table) :
class CategoryTranslation extends \Gedmo\Translatable\Entity\MappedSuperclass\AbstractTranslation
{
/**
* All required columns are mapped through inherited superclass
*/
}
but, when I run "doctrine:schema:update --dump-sql" command, I've got an error :
There is no column with name 'locale' on table 'category_translation'.
I have the feeling that yaml mapping "can't see" Gedmo AbstractTranslation class...
Do you have an idea of the problem ?
Thank you !
EDIT :
To avoid discussions in comments, I post an answer.
MyProject\MyBundle\Entity\Category:
type: entity
table: category
repositoryClass: MyProject\MyBundle\Repository\CategoryRepository
gedmo:
tree:
type: nested
translation:
locale: locale
entity: MyProject\MyBundle\Entity\Translation\CategoryTranslation
fields:
label:
type: string
length: 255
gedmo:
- translatable
With this config, I had to create a Translation.CategoryTranslation.orm.yml file because there is no database migration. And, there problem is really here :
MyProject\MyBundle\Entity\Translation\CategoryTranslation:
type: entity
table: category_translation
repositoryClass: Gedmo\Translatable\Entity\Repository\TranslationRepository
indexes:
category_translation_idx:
columns: [ locale, object_class, field, foreign_key ]
id:
id:
type: integer
generator:
strategy: AUTO
fields:
locale:
type: string
length: 8
object_class:
type: string
length: 255
field:
type: string
length: 32
foreign_key:
type: string
length: 64
content:
type: text
By doing this, the database migration works. I have a new table named category_translation. But, when I try to add a new translation, there is an error in my sql request generated by doctrine. Object_class field and foreign_key are null.
Here, the SQL request generated by doctrine :
INSERT INTO category_translation (locale, object_class, field, foreign_key, content) VALUES (?, ?, ?, ?, ?)' with params [\"fr\", null, \"name\", null, \"toto\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'object_class' cannot be null"}

Symfony2 SyliusRbacBundle Setup

I am exploring the option of using SyliusRbacBundle for my app. I manage to install it along with FosUserBundle. When I got to the setup part I got the following error on running the command 'sylius:rbac:initialize' following the instructions found here: http://docs.sylius.org/en/latest/bundles/SyliusRbacBundle/setup.html#setup-roles-and-permissions-in-the-database
Initializing Sylius RBAC roles and permissions.
Adding permission "Update product". (app.product_update)
Adding permission "Create product". (app.product_create)
Adding permission "Manage product". (app.product_manage)
[Doctrine\DBAL\DBALException]
An exception occurred while executing 'INSERT INTO sylius_role (code, name,
description, security_roles, tree_left, tree_right, tree_level, created_at
, updated_at, parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params
["root", "Root", null, "a:0:{}", null, null, null, "2015-05-11 16:45:34",
"2015-05-11 16:45:34", null]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'tree_left' ca
nnot be null
[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'tree_left' ca
nnot be null
sylius:rbac:initialize
This is how my config.yml looks like:
sylius_rbac:
driver: doctrine/orm
security_roles:
ROLE_ADMINISTRATION_ACCESS: Can access backend
roles:
app.admin:
name: Administrator
description: Administrator
app.product_manager:
name: Product Manager
description: muchos productos
permissions: [app.product_update, app.product_create]
roles_hierarchy:
app.admin: [app.product_manager]
permissions:
app.product_update: Update product
app.product_create: Create product
app.product_manage: Manage product
permissions_hierarchy:
app.product_manage: [app.product_create, app.product_update]
Any one has a clue how to solve it?
Thanks!
The Sylius/Rbac uses the tree behaviour from the Atlantic18/DoctrineExtensions.
You can use this in a Symfony system using the stof/StofDoctrineExtensionsBundle.
Once it has been installed you would need to enable the tree behaviour in your app/config/config.yml like..
stof_doctrine_extensions:
orm:
default:
tree: true
This should make the listener register correctly and then your fields to be auto-populated.

Resources