Magento catalog_eav_attribute foreign key fails phpmyadmin - magento

I am trying to do a simple copy of my database using phpmyadmin and I am getting an error seen at this link http://screencast.com/t/WB9WGs6mW
I have tried to dump the database with the disable foreign key option but I still get the same error after importing the database and trying to copy.
I am running magento 1.8.1.0 community just did an update recently from magento 1.8.0.0

If you are creating the dump with phpMyAdmin, I suggest you to select "Custom" as export method and tick the "Add drop table" statement in the Object creation options.
Otherwise, If you have access to the shell, you can create a dump with the --opt parameter.
mysqldump -uuser -p --opt dbname > dumpfile.sql

Be sure you follow this instructions in phpmyadmin export:
Export Method: custom
Format specific options: tick Disable foreign keys check
in Object creation options: tick Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement
in Data creation options: tick Truncate table before insert
Let me know if it works.

Related

can I create tables and RLS via any external API or similar?

I need to create a custom admin tool, where I create tables and RLS rules outside the Supabase admin dashboard.
Is this possible?
You can use any database interaction tool to do this. I am using a nodejs database migration tool in one of my project along with a nodejs postgres client and I'm able to create tables, enable RLS and write policies with this. You can see all the files doing these tasks in my project here.
Found out in the documentation for RLS, and in combination with the SQL editor (https://supabase.com/docs/guides/auth/row-level-security)
Wrap this bit in a database function with parameters
-- 1. Create table
create table profiles (
id uuid references auth.users,
avatar_url text
);
-- 2. Enable RLS
alter table profiles
enable row level security;
-- 3. Create Policy
create policy "Public profiles are viewable by everyone."
on profiles for select using (
true
);
Then call the function with rpc call

how can import "export user object" in pl/sql?

Step 1:
I went to the tools menu in origin oracle pl sql then choose export user object and select that file i need to convert to destination database like view and functions and packages etc...
Step 2 :
after that i went to destination database and open new command window and paste that file create in step1.
after that i get this error for many objects:
ora00900 : invalid sql statement
how can i import that file created with pl/sql export user object?
If you are using Oracle SQL Developer and trying to export DDL and Data, make sure that selected format is "insert". Other formats are not applicable to run as SQL statement.
If your goal is full export consider using Oracle DataPump: https://docs.oracle.com/en/database/oracle/oracle-database/19/sutil/oracle-data-pump-overview.html

Visual Studio dropping 's' off of sql server tables

When adding in tables from SQL Server to a dbml, it will drop the 's' off of the table name. One example: when adding the table 'Alias' it will change the name to 'Alia'. Is there any way to prevent this from happening?
Method of adding tables:
1) Connect to database in the Server Explorer Tab
2) Open tables folder
3) Select all the tables and drag them to the open dbml window
If you are using entity framework, and adding tables via the update wizard, there is a checkbox which says "Pluralize or singularize generated object names":
You can uncheck that and it will leave your table names alone.
Update: looks like you are drag/dropping to DBML, try this link:
Linq to SQL: How do I stop the auto generated object name from being renamed?

aspnet_regsql SQLCACHEDEPENDENCY

I have created a datatbase "testschema" and schema called "MySchema". I have
created a table "MySchema.table1" in the database. I am trying to create sql
cache dependancy on table using aspnet_regsql utitlity.
MySchema.Table1
But it throw an error.
Enabling the table for SQL cache dependency.
An error has happened. Details of the exception:
Cannot create trigger
'dbo.MySchema.Table1_AspNet_SqlCacheNotification_Trigger'
as its schema is different from the schema of the target table or view.
Failed during cache dependency registration.
Please make sure the database name and the table name are valid. Table names
mus
t conform to the format of regular identifiers in SQL.
The failing SQL command is:
dbo.AspNet_SqlCacheRegisterTableStoredProcedure
I have tried with out schema name and again it is failed. Pl. let me know
what's wrong creating dependancy on table?
Found it !
http://forums.asp.net/t/1249281.aspx/1
The problem occured if you have more other schema on your db (other than [dbo])
after the change made to the sp AspNet_SqlCacheRegisterTableStoredProcedure
to select the schema dynamically it worked!
Thank you Vivek

MVC3 EDMmetadata table not found

I am new in MVC3 i am going to create a MVC3 test project where i am create model class name WhiteAccount with ID,Name,Email,Password property. and successfully create a DB but when i add another new property in that WhiteAccount model class and in my DB table too but it give me some error. Some people say just delete the EDMmetadata table from your DB, But Here is the problem i have no EDMmetadata table in my DB ! I create my DB by EntityFramework v4.3.1 system automatically (CodeFirst). What should i do now ?
Check for the __MigrationHistory table.
Open the nuget package manager console and run
update-database -script
It will likely give you a message about having to enable it first, follow those directions
Run: Enable-Migrations
some more info on migrations
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-code-based-migrations-walkthrough.aspx
Im gathering this table is there in your db (under system tables) and it contains your model information. Since your project changed you need to tell the migrations about the new field or delete the table (__MigrationsHistory)

Resources