Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

SQL Import problem 09 Jan 2019 20:23 #15636

Hi Admin and everyone on the forum!

Is anyone using SQL import? I would need this function for school but it doesn't work for me as expected. I try to put the file *.sql in the box and it is not working. Nothing happens. I try it give or take 100 times and I get lucky 2 times..but I try to import also foreign key and It was not working.

I have created ERD diagram and then export schema script (sql file) and now I am trying to import this file. Problem is that import function is not working and I don't know how to properly import foreign keys...

What am I doing wrong? Please help.

Here is my sql file code:
CREATE SCHEMA mytest;

CREATE TABLE mytest.country ( 
	id                   bigint UNSIGNED NOT NULL  AUTO_INCREMENT,
	country               char(100)  NOT NULL  ,
	CONSTRAINT pk_country_id PRIMARY KEY ( id ),
	CONSTRAINT unq_country_country UNIQUE ( country ) 
 ) engine=InnoDB;

CREATE TABLE mytest.street_number ( 
	id                   bigint UNSIGNED NOT NULL  AUTO_INCREMENT,
	street_number       char(20)  NOT NULL  ,
	CONSTRAINT pk_street_number_id PRIMARY KEY ( id ),
	CONSTRAINT unq_street_number_street_number UNIQUE ( street_number ) 
 ) engine=InnoDB;

CREATE TABLE mytest.street ( 
	id                   bigint UNSIGNED NOT NULL  AUTO_INCREMENT,
	street                char(150)  NOT NULL  ,
	CONSTRAINT pk_ulice_id PRIMARY KEY ( id ),
	CONSTRAINT unq_street_street UNIQUE ( street ) 
 ) engine=InnoDB;

CREATE TABLE mytest.address ( 
	id                   bigint UNSIGNED NOT NULL  AUTO_INCREMENT,
	street_number       char(20)    ,
	country               char(100)    ,
	street                char(150)    ,
	CONSTRAINT pk_address_id PRIMARY KEY ( id ),
	CONSTRAINT fk_address_street FOREIGN KEY ( street ) REFERENCES mytest.street( street ) ON DELETE NO ACTION ON UPDATE NO ACTION,
	CONSTRAINT fk_address_street_number FOREIGN KEY ( street_number ) REFERENCES mytest.street_number( street_number ) ON DELETE NO ACTION ON UPDATE NO ACTION,
	CONSTRAINT fk_address_country FOREIGN KEY ( country ) REFERENCES mytest.country( country ) ON DELETE NO ACTION ON UPDATE NO ACTION
 ) engine=InnoDB;

Please Log in or Create an account to join the conversation.

SQL Import problem 09 Jan 2019 20:52 #15637

Ockey...I switch from Firefox to Chrome.
There is also a problem with import. But now I need 20 times or more to drag file for import and then it is working.

I have look in the 1.0.sql file (from Admin com_hellomyworld) and I now I understand where I have done wrong (plural and singular)
I modify my sql script and now I foreign key is working.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.051 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started