Giter Site home page Giter Site logo

Comments (6)

mootensai avatar mootensai commented on May 14, 2024

can you provide your SQL?

from yii2-enhanced-gii.

realmarkcross avatar realmarkcross commented on May 14, 2024

This item should be reproducible by creating a table/model with a composite primary key and running the CRUD app. You will see that you can't update or delete a record until you manually put the rest of the composite key fields into the update/delete button's code as listed above.

from yii2-enhanced-gii.

mootensai avatar mootensai commented on May 14, 2024

Whew.. could you help me to fix this?

from yii2-enhanced-gii.

realmarkcross avatar realmarkcross commented on May 14, 2024

Did you find what you needed? The ticket says closed is why I ask. I can provide example how to fix if still necessary.

from yii2-enhanced-gii.

mootensai avatar mootensai commented on May 14, 2024

Hi, maybe your database schema is not right, did u use foreign keys? did your database have 2 primary keys? i've tried on my schema and it's working properly...

from yii2-enhanced-gii.

mootensai avatar mootensai commented on May 14, 2024

this is my schema

-- --------------------------------------------------------
-- Host:                         127.0.0.1
-- Server version:               5.6.20 - MySQL Community Server (GPL)
-- Server OS:                    Win32
-- HeidiSQL Version:             9.1.0.4904
-- --------------------------------------------------------

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

-- Dumping database structure for gii
CREATE DATABASE IF NOT EXISTS `gii` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `gii`;


-- Dumping structure for table gii.child1
CREATE TABLE IF NOT EXISTS `child1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `deleted_by` int(11) DEFAULT NULL,
  `lock` bigint(20) DEFAULT NULL,
  `master_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_child1_master_idx` (`master_id`),
  CONSTRAINT `fk_child1_master` FOREIGN KEY (`master_id`) REFERENCES `master` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Data exporting was unselected.


-- Dumping structure for table gii.child2
CREATE TABLE IF NOT EXISTS `child2` (
  `created_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `deleted_by` int(11) DEFAULT NULL,
  `lock` bigint(20) DEFAULT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `master_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_child2_master1_idx` (`master_id`),
  CONSTRAINT `fk_child2_master1` FOREIGN KEY (`master_id`) REFERENCES `master` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Data exporting was unselected.


-- Dumping structure for table gii.junction
CREATE TABLE IF NOT EXISTS `junction` (
  `master_id` int(11) NOT NULL,
  `master2_id` int(11) NOT NULL,
  PRIMARY KEY (`master_id`,`master2_id`),
  KEY `FK__master2` (`master2_id`,`master_id`),
  CONSTRAINT `FK__master` FOREIGN KEY (`master_id`) REFERENCES `master` (`id`),
  CONSTRAINT `FK__master2` FOREIGN KEY (`master2_id`) REFERENCES `master2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Data exporting was unselected.


-- Dumping structure for table gii.master
CREATE TABLE IF NOT EXISTS `master` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `created_at` datetime DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `deleted_by` int(11) DEFAULT NULL,
  `lock` bigint(20) DEFAULT NULL,
  `absensicol` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Data exporting was unselected.


-- Dumping structure for table gii.master2
CREATE TABLE IF NOT EXISTS `master2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `Column` varchar(50) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- Data exporting was unselected.
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

from yii2-enhanced-gii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.