mirror of
https://github.com/Alvin-Zilverstand/school.git
synced 2026-03-07 13:27:51 +01:00
add challenge 11(portifolio)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- Create database
|
||||
CREATE DATABASE IF NOT EXISTS portfolio;
|
||||
USE portfolio;
|
||||
|
||||
-- Create projects table
|
||||
CREATE TABLE IF NOT EXISTS projects (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
description TEXT,
|
||||
image_url VARCHAR(255),
|
||||
project_url VARCHAR(255),
|
||||
tags VARCHAR(255),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Insert a sample project
|
||||
INSERT INTO projects (title, description, image_url, project_url, tags)
|
||||
VALUES (
|
||||
'Sample Project',
|
||||
'This is a sample project description.',
|
||||
'assets/sample.jpg',
|
||||
'https://example.com',
|
||||
'html,css,school'
|
||||
);
|
||||
@@ -0,0 +1,5 @@
|
||||
-- Add long_description column to projects table
|
||||
ALTER TABLE projects ADD COLUMN long_description TEXT AFTER description;
|
||||
|
||||
-- Update existing projects with long descriptions (optional)
|
||||
UPDATE projects SET long_description = description WHERE long_description IS NULL;
|
||||
Reference in New Issue
Block a user