Symmetricds error Unable to reload rows for missing foreign key data for table 'ir_model_fields' - symmetricds

I'm using symmetricds and i have this problem Unable to reload rows for missing foreign key data for table 'ir_model_fields'

Make sure you're syncing all tables that are referenced through foreign keys.

Related

Oracle (ORA-02270) : no matching unique or primary key for this column-list error: when referencing a materialized view

I am getting the ORA-2270 error when I try to create some Oracle tables.
The error is quite simple from what I have read so far:
It happens when the columns I reference in the foreign key do not
match a primary key or unique constraint on the parent table.
The problem is that my tables have several foreign keys, and I am trying to reference a PK column on a materialized view (because I do not have the chance of getting access to the real table, only the MV).
How can I then create my tables and reference them to the correct PKs in the materialized view given that MVs does not have PKs?
And generally talking... What is the common procedure once this problem occurs?
Thanks in advance.

Magento Database - Missing primary keys for some tables - Issue?

Today I found that some database tables in my Magento 1.9.0.1 installation don't have primary keys. I found out during a search and replace in the database.
Are the primary keys important to run Magento properly? If so, how do I add them to the tables? I've checked out the Magento Database Repair Tool, however that only fixed foreign keys, not primary keys.
Any thoughts?
Thanks.
Missing primary keys:
The table "api_session" has no primary key. Changes will have to be made manually.
The table "catalog_category_anc_categs_index_idx" has no primary key. Changes will have to be made manually.
The table "catalog_category_anc_categs_index_tmp" has no primary key. Changes will have to be made manually.
The table "catalog_category_anc_products_index_idx" has no primary key. Changes will have to be made manually.
The table "catalog_category_anc_products_index_tmp" has no primary key. Changes will have to be made manually.
The table "catalog_category_product_index_enbl_idx" has no primary key. Changes will have to be made manually.
The table "catalog_category_product_index_enbl_tmp" has no primary key. Changes will have to be made manually.
The table "catalog_category_product_index_idx" has no primary key. Changes will have to be made manually.
The table "catalog_category_product_index_tmp" has no primary key. Changes will have to be made manually.
The table "log_url" has no primary key. Changes will have to be made manually.
The table "shipment_carriers" has no primary key. Changes will have to be made manually.
The table "shipment_export" has no primary key. Changes will have to be made manually.
The table "weee_discount" has no primary key. Changes will have to be made manually.
The following table in your list should have a primary key:
log_url
The following tables are not in out of the box Magento:
shipment_carriers
shipment_export
The rest of the tables do not have primary keys. This is okay, not all tables need to have primary keys, for example tables that join two tables or temporary tables. All the index tables are temporary and get cleared out pretty frequently, therefore no primary key needed.

oracle get tables that reference given primary key value

In out DB we have a table called "AGENCY" with AGENCY_ID as primary key (PK). There are also about 30 tables that use AGENCY_ID as a foreign key (FK) which references PK in "AGENCY" table.
Is there a way to count how many times a specific PK value AGENCY_ID (i.e. 1004) is referenced as FK in all of the 30 "referencing" tables without checking each individual linked table.
Referential Integrity exception gets thrown when you try to delete row with PK referenced in another table, so I assume there must be a way to check if references in other tables exist.
I tried looking at all_constraints and all_tab_columns tables, but they do not solve the problem. Any ideas how to solve it? Thanks
I don't think any data dictionary view is available for achieving your goal but you should need to create procedure or function to achieve this goal. Without this you cannot get result of PK value AGENCY_ID (i.e. 1004) referenced or not if referenced then how many times.

Table with no primary foreign key match

Is it possible to have a table in a database that has no primary foreign key match up?
The table will be holding file paths to particular files and directories that I want to upload which doesn't relate to any of the other tables in the database. Is this good practise or should all tables have a primary foreign key match up? If so should I create a separate database with just this table?
Every table should have a key but that doesn't mean it has to have a foreign key referencing it. The purpose of the key is to ensure that data is uniquely identifiable and guarantee that the expected set of dependencies is enforced.

How can we make foreign key among tables after inserting data in those tables?

I have created tables in sql server. And i have also inserted data/rows in that tables.
Now i want to make relationship among them means i want to create foreign key constraints among them, is it possible ?
Whenever i try to create relationship among table a problem is occured. "Saving changes is permitted, The changes you made required table to re-created and dropped"
Please suggest me what should i do to make relationship(foreign key) among them ?
My Child table design is this
this is my parent table:-
please now right what alter query i should write..?
You can try this link
"Error message when you try to save a table in SQL Server 2008: "Saving changes is not permitted"
Another solution is below.
I think the problem is because of a feature when using the GUI. If you have a look at this link it shows you how to work round it. It is a feature which prevents you from dropping and recreating the table which is what SSMS does in the background when you click ok.
The code provided by the previous posted is the best way to do this.
You could do this with a script like this:
alter table ChildTable
add constraint FK_ChildTable_ColumnName foreign key (ColumnName) references ParentTable(PrimaryKeyColumnName)
[Edit] If I read your description correctly the script would be:
alter table emp
add constraint FK_emp_salary foreign key(salary) references testing(roll)
You can only add foreign constraints that aren't violated by existing data. You may also have to add suitable indices first, although this depends on the DBMS. In any case, first make sure your existing data is compatible with the foreign keys you want to introduce. In other words, if you were to create the foreign key first, and then insert the data, you should not produce any foreign key violations.

Resources