[gelöst] Probleme mit .install
![](https://www.drupalcenter.de/files/imagecache/upic_mini/pictures/picture-8216.jpg)
am 09.08.2009 - 16:24 Uhr in
Moin,
ich versuche schon länger bei einem Modul eine Tabelle in der DB an zu legen...
Leider funktioniert es nicht und ich bin mit meinem Latein am Ende.
Hier mein Inhalt der .install Datei.
<?php
//The DB Table and Fields
function swap_install() {
// Create my tables.
drupal_install_schema('swap');
}
function swap_schema() {
$schema = array();
$schema['node_swap'] = array(
'description' => t('The table for swap-nodes relationship.'),
'fields' => array(
'offer_nid' => array(
'description' => t('The identifier for a node that is a offer.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'demand_nid' => array(
'description' => t('The nid from the swap item node.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'not_accept' => array(
'description' => t('The status of the swap.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'accept' => array(
'description' => t('Status when the offer was accepted.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('offer_nid')
);
return $schema;
}
function swap_uninstall() {
// Drop my tables.
drupal_uninstall_schema('swap');
}
Kann mir jemand dazu mal nen heißen Tipp geben?
Danke.
- Anmelden oder Registrieren um Kommentare zu schreiben
Für mich sieht es gut
am 09.08.2009 - 19:19 Uhr
Für mich sieht es gut aus.
Hattest du mal probiert mit devel das Modul nochmal neuzuinstallieren?
--------------
Blog www.freeblogger.org: Deutscher IRC-Channel: irc.freenode.net #drupal.de ... Jabber-me: dwehner@im.calug.de
SirFiChi ist auch dein Halbgott.
Hi ich habe gerade das
am 09.08.2009 - 19:23 Uhr
Hi ich habe gerade das Problem lösen können. :-)
Da ich das Modul vorher schon installiert hatte, hat sich Drupal blöderweise in der Tabelle "System" mein Modul gemerkt und deshalb irgendwie nicht den hook_install neu aufgerufen.
Ich habe den Eintrag gelöscht und schon gings.
Dennoch Danke für deine Zeit.