Giter Site home page Giter Site logo

os_assignment_16_jun_05's Introduction

Module 16 Assignment (June 05, 2023)

Laravel Migration Concepts

Task 1:

Create a new Laravel project named MigrationAssignment using the Laravel command-line interface.

Task 2:

Within the project, create a new migration file named create_products_table that will be responsible for creating a table called products in the database. The products table should have the following columns:

id: an auto-incrementing integer and primary key.

name: a string column to store the product name.

price: a decimal column to store the product price.

description: a text column to store the product description.

created_at: a timestamp column to store the creation date and time.

updated_at: a timestamp column to store the last update date and time.

Task 3:

After creating the migration file, run the migration to create the products table in the database.

Task 4:

Modify the existing migration file create_products_table to add a new column called quantity to the products table. The quantity column should be an integer column and allow null values.

Task 5:

Create a new migration file named add_category_to_products_table that will be responsible for adding a new column called category to the products table. The category column should be a string column with a maximum length of 50 characters.

Task 6:

After creating the new migration file, run the migration to add the category column to the products table.

Task 7:

Create a new migration file named create_orders_table that will be responsible for creating a table called orders in the database. The orders table should have the following columns:

id: an auto-incrementing integer and primary key.

product_id: an unsigned integer column to establish a foreign key relationship with the `id` column of the `products` table.

quantity: an integer column to store the quantity of products ordered.

created_at: a timestamp column to store the creation date and time.

updated_at: a timestamp column to store the last update date and time.

Task 8:

After creating the migration file for the orders table, run the migration to create the orders table in the database.

Submission Instruction :

Please submit your github repository link.

os_assignment_16_jun_05's People

Contributors

kavedweller avatar

Watchers

 avatar

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.