Coder Social home page Coder Social logo

database-command's People

Contributors

addicted2sounds avatar marc7000 avatar maxxer avatar schmunk42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

database-command's Issues

fix help and index action

continued from #17 (comment)

Running command without any parameters (i.e. yiic edatabase) does display help, but also throws Error: Unknown action: index error. You may want to mute that somehow.

PostgreSQL support

Hi,

Looks like this is somewhat MySQL-centric currently, for example the generated PKs have AUTO_INCREMENT in them, which doesn't work on PG.

Has anyone modified this to work with PostgreSQL yet, and have anything to share?

composite primary key

When the primary key is composed of two columns, the command generation is also incorrect:

CREATE TABLE IF NOT EXISTS `alert_listener` (
  `alert_listener_id` int(11) NOT NULL AUTO_INCREMENT,
  `listener` varchar(250) DEFAULT NULL COMMENT 'Describes the listner (email address, phone number, ...).',
  `listener_type` int(11) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT NULL,
  `entity_alert_id` int(11) NOT NULL,
  PRIMARY KEY (`alert_listener_id`,`entity_alert_id`),
  KEY `fk_alert_listener_device_alert1` (`entity_alert_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=815 ;

gives

$this->createTable(AlertListener::model()->tableName(),
                array(
                        "alert_listener_id"=>"pk",
                        "listener"=>"varchar(250)",
                        "listener_type"=>"int(11)",
                        "is_active"=>"tinyint(1)",
                        "entity_alert_id"=>"int(11) NOT NULL",
                        "PRIMARY KEY (entity_alert_id)"
                ),
                $options);

An inconsistency between docs and the code

There's an inconsistency between what you write in docs (README.md) and what you actually have in latest version of your code (tested on version 0.8.12 released on 11 Apr 2014):

  1. Docs says about yiic database command, while it actually is yiic edatabase due to naming scheme you used in your code. One must rename EDatabaseCommand class to DatabaseCommand to fix this or use yiic edatabase command instead.
  2. Running command without any parameters (i.e. yiic edatabase) does display help, but also throws Error: Unknown action: index error. You may want to mute that somehow.

For people, who are using yiic commands for the first time, it would be a great addition to extend installation part of your doc as well. Two-line paragraph mentioning, that contents of zip file should be placed in protected/commands (which must be created, if does not exist) and that it must be placed without folder structure (just, as is, including views folder), which is contrary to extensions for example, which can be placed in subfolders, etc. That would help a lot to newbies, like me.

Aside above, thank you very much for a wonderful extension, which saves hours of coding!

wildcard for db dump

dumping with
--prefix=news
also dumps "newsCategory" or "newsSomething"

would be great to get those other tables dumped only when using a wildcard
--prefix=news >>> dumps "news"
--prefix=news* >>> dumps "news", "newsCategory", "newsSomething"

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.