Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / install.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/install.twig
new file mode 100644 (file)
index 0000000..cadbcf3
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * @file
+ * Install, update and uninstall functions for the {{ name }} module.
+ */
+
+/**
+ * Implements hook_schema().
+ */
+function {{ machine_name }}_schema() {
+  $schema['{{ machine_name }}_table'] = array(
+    'description' => 'Table description',
+    'fields' => array(
+      'id' => array(
+        'type' => 'serial',
+        'not null' => TRUE,
+        'description' => 'Primary Key: Unique ID.',
+      ),
+      'title' => array(
+        'type' => 'varchar',
+        'length' => 64,
+        'not null' => TRUE,
+        'default' => '',
+        'description' => 'Column description',
+      ),
+      'weight' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'Column description',
+      ),
+    ),
+    'primary key' => array('id'),
+    'unique keys' => array(
+      'title' => array('title'),
+    ),
+    'indexes' => array(
+      'weight' => array('weight'),
+    ),
+  );
+
+  return $schema;
+}